# 圓弧

`Workplane` 提供了多個建立圓弧的方法，包括了 `radiusArc``threePointArc``tangentArcPoint``sagittaArc`

``````import cadquery as cq

petal = (cq.Workplane()
.wire()
.extrude(1)
)

flower = cq.Workplane()
for i in range(8):
flower.add(petal.rotate((0, 0, 0), (0, 0, 1), 45 * i))

show_object(flower)
``````

`threePointArc` 是用目前的點、指定的另外兩個點構成三角形，然後計算出三角形的外接圓，取通過目前的點、指定的另外兩點之弧：

``````import cadquery as cq

arc = (cq.Workplane()
.threePointArc((10, 10), (0, 10)).close()
.extrude(1)
)

tri = (cq.Workplane()
.lineTo(10, 10)
.lineTo(0, 10)
.close()
.extrude(2)
)
``````

``````import cadquery as cq

tri = (cq.Workplane()
.lineTo(10, 10)
.lineTo(0, 20)
.close()
)

arc = (cq.Workplane()
.lineTo(5, 5)
.tangentArcPoint((5, 15), relative = False)
.lineTo(0, 20)
.close()
.extrude(2)
)
``````

`tangentArcPoint``relative` 預設為 `True`，表示指定終點時是相對於目前的點，這邊的範例使用絕對座標，來看看畫出來的模型：

`sagittaArc` 可以使用目前的點、終點與矢量（sagitta）來建立弧形，矢量是指：

``````import cadquery as cq

petal = (cq.Workplane()
.moveTo(0, -10)
.sagittaArc((0, 10), 2)
.sagittaArc((0, -10), 2)
.wire()
.extrude(1)
)

flower = cq.Workplane()
for i in range(8):
flower.add(petal.rotate((0, 0, 0), (0, 0, 1), 45 * i))

show_object(flower)
``````