Sphere¶
⚙️ Spec sheet → — visual schematic and metrics measured from a real rendered STL.
Spheres, spheroids, onions and teardrops.
-
pybosl2.shapes3d.sphere.sphere(radius=
None, diameter=None, circumscribe=False, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ Return a sphere, built with the builtin sphere(), with BOSL2-style anchor/spin/orient support.
Note: style= is accepted for signature compatibility but not applied; the builtin sphere() is used directly.
- Parameters:¶
- radius : float | None¶
radius of the sphere
- diameter : float | None¶
diameter of the sphere
- circumscribe : bool¶
circumscribe rather than inscribe the sphere (default False)
- anchor : Anchor | Sequence[float]¶
anchor point (default CENTER)
- spin : float¶
Z-axis rotation in degrees after anchor (default 0)
- orient : Anchor | Sequence[float]¶
direction to rotate the top towards, after spin (default UP)
- fn : int | None¶
arc smoothness overrides
- fa : float | None¶
arc smoothness overrides
- fs : float | None¶
arc smoothness overrides
- Return type:¶
Bosl2Solid
Examples
from pybosl2.solid import sphere shape = sphere(radius=15) shape.show()Loading 3-D preview…
-
pybosl2.shapes3d.sphere.spheroid(radius=
None, diameter=None, circumscribe=False, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ Return an approximate sphere; this pure-Python port just builds a plain sphere() (style/dual are ignored).
- Parameters:¶
- radius : float | None¶
radius of the spheroid
- diameter : float | None¶
diameter of the spheroid
- circumscribe : bool¶
circumscribe rather than inscribe the spheroid (default False)
- anchor : Anchor | Sequence[float]¶
anchor point (default CENTER)
- spin : float¶
Z-axis rotation in degrees after anchor (default 0)
- orient : Anchor | Sequence[float]¶
direction to rotate the top towards, after spin (default UP)
- fn : int | None¶
arc smoothness overrides
- fa : float | None¶
arc smoothness overrides
- fs : float | None¶
arc smoothness overrides
- Return type:¶
Bosl2Solid
Examples
from pybosl2.solid import spheroid spheroid(radius=15).show()Loading 3-D preview…
-
pybosl2.shapes3d.sphere.teardrop(height=
None, radius=None, angle=45, cap_height=None, circumscribe=False, radius1=None, radius2=None, diameter=None, diameter1=None, diameter2=None, cap_h1=None, cap_h2=None, chamfer=0, chamfer1=0, chamfer2=0, realign=False, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ BOSL2 teardrop() – a teardrop shape, useful for 3D-printable horizontal holes.
- Parameters:¶
- height : float | None¶
thickness of the teardrop (default 1)
- radius : float | None¶
radius of the circular part (default 1)
- angle : float¶
angle of the hat walls from the Z axis in degrees (default 45)
- cap_height : float | None¶
height above center to truncate the shape (default: no truncation)
- circumscribe : bool¶
produce a circumscribing teardrop shape (default False)
- radius1 : float | None¶
radius of the circular portion of the front end
- radius2 : float | None¶
radius of the circular portion of the back end
- diameter : float | None¶
diameter of the circular portion
- diameter1 : float | None¶
diameter of the front end
- diameter2 : float | None¶
diameter of the back end
- cap_h1 : float | None¶
truncation height on the front side
- cap_h2 : float | None¶
truncation height on the back side
- chamfer : float¶
chamfer size along the bottom/top faces (overall) (default 0)
- chamfer1 : float¶
chamfer size along the bottom face (default 0)
- chamfer2 : float¶
chamfer size along the top face (default 0)
- realign : bool¶
shift face alignment, passed to teardrop2d (default False)
- anchor : Anchor | Sequence[float]¶
anchor point (default CENTER)
- spin : float¶
Z-axis rotation in degrees after anchor (default 0)
- orient : Anchor | Sequence[float]¶
direction to rotate the top towards, after spin (default UP)
- fn : int | None¶
arc smoothness overrides
- fa : float | None¶
arc smoothness overrides
- fs : float | None¶
arc smoothness overrides
- Return type:¶
Bosl2Solid
Examples
from pybosl2.solid import teardrop shape = teardrop(radius=8, angle=45, height=15) shape.show()Loading 3-D preview…
-
pybosl2.shapes3d.sphere.onion(radius=
None, angle=45, cap_height=None, circumscribe=False, diameter=None, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ BOSL2 onion() – an onion-dome shape (a sphere with a conical cap).
- Parameters:¶
- radius : float | None¶
radius of the spherical portion of the bottom (default 1)
- angle : float¶
angle of the cone from vertical in degrees (default 45)
- cap_height : float | None¶
height above the sphere center to truncate the shape (default: no truncation)
- circumscribe : bool¶
circumscribe rather than inscribe the given radius/diameter (default False)
- diameter : float | None¶
diameter of the spherical portion of the bottom
- anchor : Anchor | Sequence[float]¶
anchor point (default CENTER)
- spin : float¶
Z-axis rotation in degrees after anchor (default 0)
- orient : Anchor | Sequence[float]¶
direction to rotate the top towards, after spin (default UP)
- fn : int | None¶
arc smoothness overrides
- fa : float | None¶
arc smoothness overrides
- fs : float | None¶
arc smoothness overrides
- Return type:¶
Bosl2Solid
Examples
from pybosl2.solid import onion onion(radius=15).show()Loading 3-D preview…