mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
shape_builder docs test
This commit is contained in:
@@ -127,13 +127,16 @@ class ShapeBuilder:
|
|||||||
|
|
||||||
def rectangle(self, size: Vector = Vector((1.0, 1.0)).freeze(), position: Vector = None):
|
def rectangle(self, size: Vector = Vector((1.0, 1.0)).freeze(), position: Vector = None):
|
||||||
"""
|
"""
|
||||||
function supports both 2d and 3d rectangle sizes
|
Generate a rectangle polyline, method supports both 2d and 3d rectangle sizes.
|
||||||
|
|
||||||
|
:param size: rectangle size
|
||||||
|
:param type: Vector
|
||||||
|
:param size: rectangle position, default to `None`.
|
||||||
if `position` not specified zero-vector will be used
|
if `position` not specified zero-vector will be used
|
||||||
|
:param type: Vector, optional
|
||||||
|
|
||||||
returns IfcIndexedPolyCurve
|
:return: IfcIndexedPolyCurve
|
||||||
"""
|
"""
|
||||||
# < IfcIndexedPolyCurve
|
|
||||||
return self.polyline(self.get_rectangle_coords(size, position), closed=True)
|
return self.polyline(self.get_rectangle_coords(size, position), closed=True)
|
||||||
|
|
||||||
def circle(self, center: Vector = Vector((0.0, 0.0)).freeze(), radius=1.0):
|
def circle(self, center: Vector = Vector((0.0, 0.0)).freeze(), radius=1.0):
|
||||||
@@ -572,9 +575,17 @@ class ShapeBuilder:
|
|||||||
disk_solid = self.file.createIfcSweptDiskSolid(Directrix=path_curve, Radius=radius)
|
disk_solid = self.file.createIfcSweptDiskSolid(Directrix=path_curve, Radius=radius)
|
||||||
return disk_solid
|
return disk_solid
|
||||||
|
|
||||||
def get_representation(self, context, items, representation_type=None):
|
def get_representation(self, context, items, representation_type:str = None):
|
||||||
# > items - could be a list or single curve/IfcExtrudedAreaSolid
|
"""Create IFC representation for the specified context and items.
|
||||||
# < IfcShapeRepresentation
|
|
||||||
|
:param context: IfcGeometricRepresentationSubContext
|
||||||
|
:param items: could be a list or single curve/IfcExtrudedAreaSolid
|
||||||
|
:param representation_type: Explicitly specified RepresentationType, defaults to `None`.
|
||||||
|
If not provided it will be guessed from the items types.
|
||||||
|
:type representation_type: str, optional
|
||||||
|
|
||||||
|
:return: IfcRepresentation
|
||||||
|
"""
|
||||||
if not isinstance(items, collections.abc.Iterable):
|
if not isinstance(items, collections.abc.Iterable):
|
||||||
items = [items]
|
items = [items]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user