mirror of
https://github.com/johndoe6345789/bamboogenerator.git
synced 2026-04-24 13:24:54 +00:00
22 lines
444 B
Python
22 lines
444 B
Python
from dataclasses import dataclass
|
|
|
|
from parametric_cad.core import tm
|
|
from .base import Primitive
|
|
|
|
|
|
@dataclass
|
|
class Sphere(Primitive):
|
|
"""Icosphere primitive."""
|
|
|
|
radius: float
|
|
subdivisions: int = 3
|
|
|
|
def __post_init__(self) -> None:
|
|
super().__init__()
|
|
|
|
def _create_mesh(self) -> tm.Trimesh:
|
|
return tm.creation.icosphere(
|
|
subdivisions=self.subdivisions,
|
|
radius=self.radius,
|
|
)
|