mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
typing
This commit is contained in:
@@ -18,13 +18,22 @@
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Optional, Literal
|
||||
|
||||
|
||||
SURFACE_STYLE_TYPES = Literal[
|
||||
"IfcExternallyDefinedSurfaceStyle",
|
||||
"IfcSurfaceStyleLighting",
|
||||
"IfcSurfaceStyleRefraction",
|
||||
"IfcSurfaceStyleShading",
|
||||
"IfcSurfaceStyleWithTextures",
|
||||
]
|
||||
|
||||
|
||||
def add_surface_style(
|
||||
file: ifcopenshell.file,
|
||||
style: ifcopenshell.entity_instance,
|
||||
ifc_class: str = "IfcSurfaceStyleShading",
|
||||
ifc_class: SURFACE_STYLE_TYPES = "IfcSurfaceStyleShading",
|
||||
attributes: Optional[dict[str, Any]] = None,
|
||||
) -> None:
|
||||
"""Adds a new presentation item to a surface style
|
||||
|
||||
@@ -1076,13 +1076,13 @@ class ShapeBuilder:
|
||||
)
|
||||
return points, segments, transition_arc
|
||||
|
||||
def polygonal_face_set(self, points: list[Vector], faces: list[[list[int]]]) -> ifcopenshell.entity_instance:
|
||||
def polygonal_face_set(self, points: list[Vector], faces: list[list[int]]) -> ifcopenshell.entity_instance:
|
||||
"""
|
||||
> `points` - list of points
|
||||
Generate an IfcPolygonalFaceSet.
|
||||
|
||||
> `faces` - list of faces consisted of point indices (points indices starting from 0)
|
||||
|
||||
< IfcPolygonalFaceSet
|
||||
:param points: rectangle size, could be either 2d or 3d, defaults to `(1,1)`
|
||||
:param faces: list of faces consisted of point indices (points indices starting from 0)
|
||||
:return: IfcPolygonalFaceSet
|
||||
"""
|
||||
|
||||
ifc_points = self.file.createIfcCartesianPointList3D(points)
|
||||
|
||||
Reference in New Issue
Block a user