当前位置:网站首页>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);
}
}
}
边栏推荐
- MySQL index
- Sqli - Labs Clearance (less6 - less14)
- Fe - weex uses a simple encapsulated data loading plug-in as the global loading method
- Anti shake and throttling of JS
- Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved
- The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem
- js把一个数组分割成每三个一组
- Blog directory of zzq -- updated on 20210601
- [Zhang San learns C language] - deeply understand data storage
- Review of reflection topics
猜你喜欢
PHP Session原理简析
uniapp引入本地字体
Basic knowledge of software testing
CVE-2015-1635(MS15-034 )远程代码执行漏洞复现
SQLI-LABS通关(less18-less20)
Sqli - Labs Clearance (less6 - less14)
Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence
Sentry construction and use
UEditor . Net version arbitrary file upload vulnerability recurrence
Linux MySQL 5.6.51 community generic installation tutorial
随机推荐
IDEA2020中测试PySpark的运行出错
js把一个数组分割成每三个一组
SQL注入闭合判断
Usage of map and foreach in JS
Log - 7 - record a major error in missing documents (A4 paper)
php中的数字金额转换大写数字
CVE-2015-1635(MS15-034 )遠程代碼執行漏洞複現
sqli-labs通關匯總-page2
After reading useful blogs
Sqli labs customs clearance summary-page4
CAD二次开发 对象
php中根据数字月份返回月份的英文缩写
Eslint configuration code auto format
Linux MySQL 5.6.51 Community Generic 安装教程
PIP install
IDEA2020中PySpark的两表关联(字段名相同)
Latex error: the font size command \normalsize is not defined problem solved
php中的二维数组去重
由於不正常斷電導致的unexpected inconsistency;RUN fsck MANUALLY問題已解决
The default Google browser cannot open the link (clicking the hyperlink does not respond)