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

Method makeSphere

cadquery/occ_impl/shapes.py:4335–4356  ·  view source on GitHub ↗

Make a sphere with a given radius By default pnt=Vector(0,0,0), dir=Vector(0,0,1), angle1=0, angle2=90 and angle3=360

(
        cls,
        radius: float,
        pnt: VectorLike = Vector(0, 0, 0),
        dir: VectorLike = Vector(0, 0, 1),
        angleDegrees1: float = 0,
        angleDegrees2: float = 90,
        angleDegrees3: float = 360,
    )

Source from the content-addressed store, hash-verified

4333
4334 @classmethod
4335 def makeSphere(
4336 cls,
4337 radius: float,
4338 pnt: VectorLike = Vector(0, 0, 0),
4339 dir: VectorLike = Vector(0, 0, 1),
4340 angleDegrees1: float = 0,
4341 angleDegrees2: float = 90,
4342 angleDegrees3: float = 360,
4343 ) -> Shape:
4344 """
4345 Make a sphere with a given radius
4346 By default pnt=Vector(0,0,0), dir=Vector(0,0,1), angle1=0, angle2=90 and angle3=360
4347 """
4348 return cls(
4349 BRepPrimAPI_MakeSphere(
4350 gp_Ax2(Vector(pnt).toPnt(), Vector(dir).toDir()),
4351 radius,
4352 radians(angleDegrees1),
4353 radians(angleDegrees2),
4354 radians(angleDegrees3),
4355 ).Shape()
4356 )
4357
4358 @classmethod
4359 def _extrudeAuxSpine(

Callers 2

sphereMethod · 0.80
testCompSolidMethod · 0.80

Calls 3

VectorClass · 0.85
toPntMethod · 0.80
toDirMethod · 0.80

Tested by 1

testCompSolidMethod · 0.64