add multipatch geometry and units

This commit is contained in:
KatKatKateryna
2024-10-22 23:05:06 +01:00
parent 2e0743d626
commit 9ec2b59b24
2 changed files with 25 additions and 1 deletions
+2
View File
@@ -16,6 +16,7 @@ from specklepy.objects.GIS.geometry import (
GisRasterElement,
PolygonGeometry,
PolygonGeometry3d,
GisMultipatchGeometry,
)
from specklepy.objects.GIS.layers import RasterLayer, VectorLayer
@@ -25,6 +26,7 @@ __all__ = [
"GisPolygonGeometry",
"PolygonGeometry",
"PolygonGeometry3d",
"GisMultipatchGeometry",
"GisPolygonElement",
"GisLineElement",
"GisPointElement",
+23 -1
View File
@@ -22,9 +22,11 @@ class PolygonGeometry(Base, speckle_type="Objects.GIS.PolygonGeometry"):
def __init__(
self,
units: str,
boundary: Polyline,
voids: Optional[List[Polyline]] = None,
) -> None:
super().__init__(units=units)
self.boundary = boundary
self.voids = voids or []
@@ -40,10 +42,30 @@ class PolygonGeometry3d(
def __init__(
self,
units: str,
boundary: Polyline,
voids: Optional[List[Polyline]] = None,
) -> None:
super().__init__(boundary=boundary, voids=voids)
super().__init__(units=units, boundary=boundary, voids=voids)
class GisMultipatchGeometry(
Base,
speckle_type="Objects.GIS.GisMultipatchGeometry",
):
"""GIS Polygon3d Geometry"""
def __init__(
self,
units: str,
faces: List[int],
vertices: List[float],
colors: Optional[List[int]],
) -> None:
super().__init__(units=units)
self.faces = faces
self.vertices = vertices
self.colors = colors or []
@deprecated(version="2.20", reason="Replaced with GisPolygonFeature")