mirror of
https://github.com/johndoe6345789/bamboogenerator.git
synced 2026-05-06 11:09:37 +00:00
18 lines
496 B
Python
18 lines
496 B
Python
from parametric_cad.core import tm
|
|
|
|
class Sphere:
|
|
def __init__(self, radius, subdivisions=3):
|
|
self.radius = radius
|
|
self.subdivisions = subdivisions
|
|
self._position = (0, 0, 0)
|
|
|
|
def at(self, x, y, z):
|
|
self._position = (x, y, z)
|
|
return self
|
|
|
|
def mesh(self):
|
|
sph = tm.creation.icosphere(subdivisions=self.subdivisions,
|
|
radius=self.radius)
|
|
sph.apply_translation(self._position)
|
|
return sph
|