- class Surface(dtcc.Geometry)[source]
Represents a planar surface in 3D.
Public members¶
- calculate_bounds()[source]
Calculate the bounding box of the surface.
- property xmin
- property ymin
- property zmin
- property xmax
- property ymax
- property zmax
- property centroid
- calculate_normal() ndarray [source]
Calculate the normal of the surface.
-
to_polygon(simplify=
0.01
) Polygon [source] Convert the surface to a Shapely Polygon.
-
from_polygon(polygon: Polygon, height=
0
)[source] Convert a Shapely Polygon to a surface.
- from_shapely(shape)[source]
Initialize the Surface from a Shapely Polygon.
-
from_proto(pb: Geometry | bytes, only_surface_fields=
False
)[source] Initialize Surface from a protobuf representation.
- Surface(...)
Initialize self. See help(type(self)) for accurate signature.
- __repr__()
Return repr(self).
- __eq__(other)
Return self==value.
-
mesh(triangle_size=
None
) Mesh Mesh a Surface object into a Mesh object.
- view()
View a surface in 3D with a GLFW window.
- vertices : ndarray
- normal : ndarray
- holes : list[ndarray]
- property bounds
- to_json() str
Return a JSON representation of the object.
- copy(**kwargs)
Return a copy of the object.
-
classmethod add_methods(module, name=
None
) Adds methods from a module or function to the class.
-
classmethod print_methods(verbose=
False
) Print the methods that have been added to the class.