The threePointArc() method is used to create a 3-point arc on a 2D workplane in the CAD modeling library, CadQuery. This method takes in 3 points - a start point, intermediate point, and end point - to create the arc.
threePointArc(startPoint, intermediatePoint, endPoint, radius=None, forConstruction=False)
startPoint: A tuple or list specifying the (x, y) coordinates of the start point of the 3-point arc.intermediatePoint: A tuple or list specifying the (x, y) coordinates of an intermediate point on the arc.endPoint: A tuple or list specifying the (x, y) coordinates of the end point of the 3-point arc.radius: An optional parameter that specifies the radius of the arc. If not provided, the radius is computed based on the 3 points provided.forConstruction: An optional parameter that specifies whether the arc is for construction or not. If set to True, the arc is not included in the final 3D model.A Workplane object.
import cadquery as cq
# Create a workplane
w = cq.Workplane()
# Define 3 points
start_point = (0, 0)
intermediate_point = (2, 3)
end_point = (4, 0)
# Create a 3-point arc with a radius of 2
arc = w.threePointArc(start_point, intermediate_point, end_point, radius=2)
# Extrude the arc
model = arc.extrude(1)
# Show the model
show_object(model)
This code creates a workplane and defines 3 points: start_point, intermediate_point, and end_point. It then creates a 3-point arc on the workplane with a radius of 2 using the threePointArc() method. Finally, the arc is extruded by 1 unit using the extrude() method and the resulting model is shown.