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

Method makeCircle

cadquery/occ_impl/shapes.py:2618–2638  ·  view source on GitHub ↗
(
        cls,
        radius: float,
        pnt: VectorLike = Vector(0, 0, 0),
        dir: VectorLike = Vector(0, 0, 1),
        angle1: float = 360.0,
        angle2: float = 360,
        orientation: bool = True,
    )

Source from the content-addressed store, hash-verified

2616
2617 @classmethod
2618 def makeCircle(
2619 cls,
2620 radius: float,
2621 pnt: VectorLike = Vector(0, 0, 0),
2622 dir: VectorLike = Vector(0, 0, 1),
2623 angle1: float = 360.0,
2624 angle2: float = 360,
2625 orientation: bool = True,
2626 ) -> Edge:
2627 pnt = Vector(pnt)
2628 dir = Vector(dir)
2629
2630 circle_gp = gp_Circ(gp_Ax2(pnt.toPnt(), dir.toDir()), radius)
2631
2632 if angle1 == angle2: # full circle case
2633 return cls(BRepBuilderAPI_MakeEdge(circle_gp).Edge())
2634 else: # arc case
2635 circle_geom = GC_MakeArcOfCircle(
2636 circle_gp, radians(angle1), radians(angle2), orientation
2637 ).Value()
2638 return cls(BRepBuilderAPI_MakeEdge(circle_geom).Edge())
2639
2640 @classmethod
2641 def makeEllipse(

Callers 15

finalize_hullFunction · 0.45
circleMethod · 0.45
arcMethod · 0.45
circleMethod · 0.45
makeCircleMethod · 0.45
_dxf_circleFunction · 0.45
_dxf_arcFunction · 0.45
testTranslateMethod · 0.45
testEdgeWrapperRadiusMethod · 0.45
test_hullFunction · 0.45
test_validationFunction · 0.45

Calls 3

toPntMethod · 0.95
toDirMethod · 0.95
VectorClass · 0.85

Tested by 14

testTranslateMethod · 0.36
testEdgeWrapperRadiusMethod · 0.36
test_hullFunction · 0.36
test_validationFunction · 0.36
testDXFMethod · 0.36
testCleanMethod · 0.36
testNoCleanMethod · 0.36
testPositionAtMethod · 0.36
testEdgeWireCloseMethod · 0.36
testSplitShapeMethod · 0.36
testEachpointMethod · 0.36