MCPcopy
hub / github.com/CadQuery/cadquery / circle

Method circle

cadquery/cq.py:2577–2609  ·  view source on GitHub ↗

Make a circle for each item on the stack. :param radius: radius of the circle :param forConstruction: should the new wires be reference geometry only? :type forConstruction: true if the wires are for reference, false if they are creating part geometry

(self: T, radius: float, forConstruction: bool = False)

Source from the content-addressed store, hash-verified

2575
2576 # circle from current point
2577 def circle(self: T, radius: float, forConstruction: bool = False) -> T:
2578 """
2579 Make a circle for each item on the stack.
2580
2581 :param radius: radius of the circle
2582 :param forConstruction: should the new wires be reference geometry only?
2583 :type forConstruction: true if the wires are for reference, false if they are creating
2584 part geometry
2585 :return: a new CQ object with the created wires on the stack
2586
2587 A common use case is to use a for-construction rectangle to define the centers of a
2588 hole pattern::
2589
2590 s = Workplane().rect(4.0, 4.0, forConstruction=True).vertices().circle(0.25)
2591
2592 Creates 4 circles at the corners of a square centered on the origin. Another common case is
2593 to use successive circle() calls to create concentric circles. This works because the
2594 center of a circle is its reference point::
2595
2596 s = Workplane().circle(2.0).circle(1.0)
2597
2598 Creates two concentric circles, which when extruded will form a ring.
2599
2600 Future Enhancements:
2601 better way to handle forConstruction
2602 project points not in the workplane plane onto the workplane plane
2603
2604 """
2605
2606 c = Wire.makeCircle(radius, Vector(), Vector(0, 0, 1))
2607 c.forConstruction = forConstruction
2608
2609 return self.eachpoint(lambda loc: c.moved(loc), True)
2610
2611 # ellipse from current point
2612 def ellipse(

Callers 15

skFunction · 0.45
test_styleFunction · 0.45
test_face_interfaceFunction · 0.45
test_distributeFunction · 0.45
test_parrayFunction · 0.45
test_finalizeFunction · 0.45
test_dxf_importFunction · 0.45
test_valFunction · 0.45
test_valsFunction · 0.45
test_circleMethod · 0.45
testDXFMethod · 0.45
testPointListMethod · 0.45

Calls 4

eachpointMethod · 0.95
VectorClass · 0.85
makeCircleMethod · 0.45
movedMethod · 0.45

Tested by 15

skFunction · 0.36
test_styleFunction · 0.36
test_face_interfaceFunction · 0.36
test_distributeFunction · 0.36
test_parrayFunction · 0.36
test_finalizeFunction · 0.36
test_dxf_importFunction · 0.36
test_valFunction · 0.36
test_valsFunction · 0.36
test_circleMethod · 0.36
testDXFMethod · 0.36
testPointListMethod · 0.36