cadquery
Sketch
Workplane
Assembly

Workplane.radiusArc()

The radiusArc() method in CadQuery's Workplane module allows for the creation of a circular arc between two points on the workplane with a specified radius.

Syntax

radiusArc(radius, startAngle=0, endAngle=360, makeWire=True, **kwargs)

Parameters

  • radius (float): radius of the circular arc.
  • startAngle (float, optional): angle (in degrees) from the positive x-axis to begin the arc. Default value is 0.
  • endAngle (float, optional): angle (in degrees) from the positive x-axis to end the arc. Default value is 360.
  • makeWire (bool, optional): if True, the result will be a Wire object representing the arc. If False, the result will be a Face object formed after extruding the arc along the Z-axis. Default value is True.

Returns

  • Wire or Face: depending on the value of makeWire, the result is a Wire object representing the arc or a Face object formed after extruding the arc along the Z-axis.

Examples

1. Creating a circular arc with 2 points

import cadquery as cq

# create a 2D workplane
w = cq.Workplane("XY")

# create two points on the workplane
p1 = cq.Vector(1, 0)
p2 = cq.Vector(2, 1)

# create a circular arc from the two points with a radius of 0.5
arc = w.lineTo(*p1).radiusArc(0.5, end=p2)

# display the arc
show_object(arc)

example1

2. Creating a semi-circle

import cadquery as cq

# create a 2D workplane
w = cq.Workplane("XY")

# create two points on the workplane
p1 = cq.Vector(0, 0)
p2 = cq.Vector(1, 0)

# create a semi-circle with a radius of 1
semi_circle = w.lineTo(*p1).radiusArc(1, end=p2, makeWire=False, startAngle=270)

# display the semi-circle
show_object(semi_circle)

example2

Notes

  • The radiusArc() method is chainable, meaning multiple arcs can be created on the same workplane by calling the method sequentially.
  • startAngle and endAngle are both measured in degrees counterclockwise from the positive x-axis.
  • By default, the makeWire parameter is set to True. If it is set to False, the resulting Face object will have zero thickness and will not be visible in the 3D view. It is recommended to only set makeWire to False when extruding the resulting shape along another axis to create a true 3D object.