Files
PolyCubeCounting/python/polycube_encoder.py
2024-02-06 17:15:45 +01:00

10 lines
261 B
Python

from json import JSONEncoder
from typing import Any
from polycube import PolyCube
class PolyCubeEncdoder(JSONEncoder):
def default(self, o: Any) -> Any:
if isinstance(o, PolyCube):
return list(o.cubes)
return super().default(o)