cqmore/polyhedron.py
def octahedron(radius: float, detail: int = 0) -> Polyhedron:
    '''
    Create a octahedron.

    ## Parameters

    - `radius`: radius of the octahedron.
    - `detail`: setting this to a value greater than 0 adds vertices making it no longer a octahedron.

    ## Examples 

        from cqmore.polyhedron import octahedron
        from cqmore import Workplane

        radius = 1
        polyhedra = Workplane()
        for detail in range(5):
            polyhedra.add(
                Workplane()
                    .polyhedron(*octahedron(radius, detail))
                    .translate((2 * radius * detail, 0, 0))
            )

    '''

    vectors = (
        Vector(1, 0, 0), Vector(-1, 0, 0), Vector(0, 1, 0), 
        Vector(0, -1, 0), Vector(0, 0, 1), Vector(0, 0, -1)
    )
    faces = (
        (0, 2, 4), (0, 4, 3),    (0, 3, 5),
        (0, 5, 2), (1, 2, 5),    (1, 5, 3),
        (1, 3, 4), (1, 4, 2)
    )
    return _divide_project(vectors, faces, radius, detail)

    Create a octahedron.

    ## Parameters

    - `radius`: radius of the octahedron.
    - `detail`: setting this to a value greater than 0 adds vertices making it no longer a octahedron.

    ## Examples 

        from cqmore.polyhedron import octahedron
        from cqmore import Workplane

        radius = 1
        polyhedra = Workplane()
        for detail in range(5):
            polyhedra.add(
                Workplane()
                    .polyhedron(*octahedron(radius, detail))
                    .translate((2 * radius * detail, 0, 0))
            )

    
Create a octahedron.
Parameters

`radius`: radius of the octahedron.
`detail`: setting this to a value greater than 0 adds vertices making it no longer a octahedron.

Examples

from cqmore.polyhedron import octahedron
from cqmore import Workplane


Create a octahedron . Parameters ` radius ` : radius of the octahedron . ` detail ` : setting this to a value greater than 0 adds vertices making it no longer a octahedron . Examples from cqmore . polyhedron import octahedron from cqmore import Workplane
def octahedron(radius: float, detail: int = 0) -> Polyhedron:
    vectors = (
        Vector(1, 0, 0), Vector(-1, 0, 0), Vector(0, 1, 0), 
        Vector(0, -1, 0), Vector(0, 0, 1), Vector(0, 0, -1)
    )
    faces = (
        (0, 2, 4), (0, 4, 3),    (0, 3, 5),
        (0, 5, 2), (1, 2, 5),    (1, 5, 3),
        (1, 3, 4), (1, 4, 2)
    )
    return _divide_project(vectors, faces, radius, detail)
def octahedron ( radius : float , detail : int = 0 ) -> Polyhedron : vectors = ( Vector ( 1 , 0 , 0 ) , Vector ( - 1 , 0 , 0 ) , Vector ( 0 , 1 , 0 ) , Vector ( 0 , - 1 , 0 ) , Vector ( 0 , 0 , 1 ) , Vector ( 0 , 0 , - 1 ) ) faces = ( ( 0 , 2 , 4 ) , ( 0 , 4 , 3 ) , ( 0 , 3 , 5 ) , ( 0 , 5 , 2 ) , ( 1 , 2 , 5 ) , ( 1 , 5 , 3 ) , ( 1 , 3 , 4 ) , ( 1 , 4 , 2 ) ) return _divide_project ( vectors , faces , radius , detail )
Create a octahedron.
Create a octahedron .
'''
    Create a octahedron.

    ## Parameters

    - `radius`: radius of the octahedron.
    - `detail`: setting this to a value greater than 0 adds vertices making it no longer a octahedron.

    ## Examples 

        from cqmore.polyhedron import octahedron
        from cqmore import Workplane

        radius = 1
        polyhedra = Workplane()
        for detail in range(5):
            polyhedra.add(
                Workplane()
                    .polyhedron(*octahedron(radius, detail))
                    .translate((2 * radius * detail, 0, 0))
            )

    '''
radius
float
detail
int