当前位置:网站首页>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);
}
}
}
边栏推荐
猜你喜欢

Sqli labs customs clearance summary-page3

Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件

Huawei mindspire open source internship machine test questions

Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved

Go package name

SQLI-LABS通关(less6-less14)
![[literature reading and thought notes 13] unprocessing images for learned raw denoising](/img/a5/ed26a90b3edd75a37b2e5164f6b7d2.png)
[literature reading and thought notes 13] unprocessing images for learned raw denoising

No process runs when querying GPU, but the video memory is occupied

Basic knowledge of software testing

Implement strstr() II
随机推荐
js删除字符串的最后一位
The default Google browser cannot open the link (clicking the hyperlink does not respond)
Underlying mechanism mvcc
CAD二次开发 对象
MySQL中的正则表达式
CTF web practice competition
CVE-2015-1635(MS15-034 )遠程代碼執行漏洞複現
JS countdown case
SQLI-LABS通關(less6-less14)
(the 100th blog) written at the end of the second year of doctor's degree -20200818
After reading useful blogs
Laravel8中的find_in_set、upsert的使用方法
Blog directory of zzq -- updated on 20210601
uniapp引入本地字体
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
Fe - wechat applet - Bluetooth ble development research and use
SQLI-LABS通关(less15-less17)
The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem
SQLI-LABS通关(less18-less20)
In depth study of JVM bottom layer (II): hotspot virtual machine object