Torus¶
⚙️ Spec sheet → — visual schematic and metrics measured from a real rendered STL.
Toruses and pie slice shapes.
-
pybosl2.shapes3d.torus.pie_slice(height=
None, radius=None, angle=30, center=None, radius1=None, radius2=None, diameter=None, diameter1=None, diameter2=None, length=None, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ BOSL2 pie_slice() – a pie slice, wedge of a cylinder/cone.
- Parameters:¶
- height : float | None¶
height of the pie slice
- length : float | None¶
height of the pie slice
- radius : float | None¶
radius of the pie slice
- angle : float¶
pie slice angle in degrees (default 30)
- center : bool | None¶
if given, overrides anchor
- radius1 : float | None¶
bottom radius of the pie slice
- radius2 : float | None¶
top radius of the pie slice
- diameter : float | None¶
diameter of the pie slice
- diameter1 : float | None¶
diameter of the bottom
- diameter2 : float | None¶
diameter of the top
- 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 pie_slice pie_slice(radius=20, angle=120, height=5).show()Loading 3-D preview…
-
pybosl2.shapes3d.torus.torus(major_radius=
None, minor_radius=None, center=None, major_diameter=None, minor_diameter=None, outer_radius=None, inner_radius=None, outer_diameter=None, inner_diameter=None, anchor=Anchor.CENTER, spin=0, orient=Anchor.TOP, fn=None, fa=None, fs=None)[source]¶ BOSL2 torus() – a torus (donut) shape.
Note: BOSL2’s outer-radius parameter is named or, which collides with the Python keyword or; it is exposed here as outer_radius instead.
- Parameters:¶
- major_radius : float | None¶
major radius of the torus ring (use with minor_radius or minor_diameter)
- minor_radius : float | None¶
minor radius of the torus ring (use with major_radius or major_diameter)
- center : bool | None¶
if given, overrides anchor (True -> CENTER, False -> DOWN)
- major_diameter : float | None¶
major diameter of the torus ring
- minor_diameter : float | None¶
minor diameter of the torus ring
- outer_radius : float | None¶
outer radius of the torus (BOSL2 or) (use with inner_radius or inner_diameter)
- inner_radius : float | None¶
inside radius of the torus (use with outer_radius or outer_diameter)
- outer_diameter : float | None¶
outer diameter of the torus (use with inner_radius or inner_diameter)
- inner_diameter : float | None¶
inside diameter of the torus (use with outer_radius or outer_diameter)
- anchor : Anchor | Sequence[float]¶
anchor point (default CENTER)
- spin : float¶
Z-axis rotation in degrees (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 torus shape = torus(major_radius=25, minor_radius=8) shape.show()Loading 3-D preview…