The Workplane.circle() method is used to create a circle on a Workplane object in CadQuery. It takes two parameters: the radius of the circle and an optional number of segments used to create the circle.
Workplane.circle(radius, segments)
radius
(float): the radius of the circle to be created.segments
(int, optional): the number of segments used to create the circle. Default value is 32.The Workplane.circle() method returns a new Workplane object with a circle on it.
import cadquery as cq
# Create a new Workplane object
result = cq.Workplane("XY")
# Create a circle with a radius of 1.0
circle = result.circle(1.0)
# Display the result
show_object(circle)
Output:
import cadquery as cq
# Create a new Workplane object
result = cq.Workplane("XY")
# Create a circle with a radius of 1.0 and 64 segments
circle = result.circle(1.0, segments=64)
# Display the result
show_object(circle)
Output: