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

    ## Parameters

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

    ## Examples 

        from cqmore.polyhedron import tetrahedron
        from cqmore import Workplane

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

    '''

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

    Create a tetrahedron.

    ## Parameters

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

    ## Examples 

        from cqmore.polyhedron import tetrahedron
        from cqmore import Workplane

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

    
Create a tetrahedron.
Parameters

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

Examples

from cqmore.polyhedron import tetrahedron
from cqmore import Workplane


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

    ## Parameters

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

    ## Examples 

        from cqmore.polyhedron import tetrahedron
        from cqmore import Workplane

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

    '''
radius
float
detail
int