initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
from typing import Iterable
|
||||
from specklepy.objects import Base
|
||||
|
||||
|
||||
def flatten_base(base: Base) -> Iterable[Base]:
|
||||
if hasattr(base, "elements"):
|
||||
for element in base.elements:
|
||||
yield from flatten_base(element)
|
||||
yield base
|
||||
Reference in New Issue
Block a user