-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Python): Add Pyodide Mesh support
- Loading branch information
Showing
6 changed files
with
105 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
from dataclasses import dataclass | ||
from dataclasses import dataclass, field | ||
|
||
from typing import Optional | ||
from typing import Optional, Union, Dict | ||
|
||
try: | ||
from numpy.typing import ArrayLike | ||
except ImportError: | ||
from numpy import ndarray as ArrayLike | ||
|
||
from .float_types import FloatTypes | ||
from .int_types import IntTypes | ||
from .pixel_types import PixelTypes | ||
|
||
@dataclass | ||
class PointSetType: | ||
dimension: int | ||
dimension: int = 3 | ||
|
||
pointComponentType: str | ||
pointPixelComponentType: str | ||
pointPixelType: str | ||
pointPixelComponents: int | ||
pointComponentType: Union[IntTypes, FloatTypes] = FloatTypes.Float32 | ||
pointPixelComponentType: Union[IntTypes, FloatTypes] = FloatTypes.Float32 | ||
pointPixelType: PixelTypes = PixelTypes.Scalar | ||
pointPixelComponents: int = 1 | ||
|
||
|
||
@dataclass | ||
class PointSet: | ||
pointSetType: PointSetType | ||
pointSetType: Union[PointSetType, Dict] = field(default_factory=PointSetType) | ||
|
||
name: str = 'PointSet' | ||
|
||
name: str | ||
numberOfPoints: int = 0 | ||
points: Optional[ArrayLike] = None | ||
|
||
numberOfPoints: int | ||
points: Optional[ArrayLike] | ||
numberOfPointPixels: int = 0 | ||
pointData: Optional[ArrayLike] = None | ||
|
||
numberOfPointPixels: int | ||
pointData: Optional[ArrayLike] | ||
def __post_init__(self): | ||
if isinstance(self.pointSetType, dict): | ||
self.pointSetType = PointSetType(**self.pointSetType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters