Arc
We can create the arc by instantiating an McDbArc() object.
You can draw an arc by setting the center of the McDbArc() instance object, radius, startAngle, and endAngle. The arc can also be drawn by setting the starting point, the middle point, and the end point through the computeArc() method provided by McDbArc().
In addition, methods for drawing arcs provided by mxcad examples are also available, such as drawArc(), drawArc2(), drawArc3().
Click McDbArc() to check the properties and methods in detail.
Click drawArc(),drawArc2(),drawArc3() to check the properties and methods in detail.
ts
import { MxCpp, McGePoint3d, McDbArc, McCmColor } from "mxcad"
const mxcad = MxCpp.getCurrentMxCAD()
const arc = new McDbArc()
arc.center = new McGePoint3d(-100, -100),
arc.radius = 20
arc.startAngle = Math.PI / 2
arc.endAngle = Math.PI * 3 / 2
arc.trueColor = new McCmColor(255, 233, 0)
mxcad.drawEntity(arc)
const arc_1 = new McDbArc()
const pt1 = new McGePoint3d(-60,-80)
const pt2 = new McGePoint3d(-80,-100)
const pt3 = new McGePoint3d(-60,-120)
arc_1.computeArc(pt1.x,pt1.y,pt2.x,pt2.y,pt3.x,pt3.y)
mxcad.drawEntity(arc_1)
mxcad.drawArc(-120, -100, 20, 100, 250);
mxcad.drawArc2(pt1.x,pt1.y,pt2.x,pt2.y,pt3.x,pt3.y)
mxcad.drawArc3(pt1.x,pt1.y,pt2.x,pt2.y,0.2)