mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 01:10:01 +00:00
Added ShapeBuilder class and library for non structural assets (
`ShapeBuilder` class is used to programmatically create 2d and 3d ifc shapes and representations. It's inspired by the way OpenSCAD language is designed - the goal was to create a readable and easy way to create new shapes. The class can be imported from `ifcopenshell.util.representation` module. Examples of things created with `ShapeBuilder` can be found in `shape_builder_examples.py` or `generate_furniture_library.py` / `Non_structural_assets_library.ifc`. Also added ifc library of non structual assets (furniture etc) - `Non_structural_assets_library.ifc`. All assets are using most common dimensions for them - it makes it good for prototyping. Related to https://community.osarch.org/discussion/1192
This commit is contained in:
@@ -90,15 +90,15 @@ def create_simple_2dcurve(coords, fillets, fillet_radius, closed=True, ifc_file=
|
||||
ifc_curve = None
|
||||
if ifc_file:
|
||||
ifc_points = ifc_file.createIfcCartesianPointList2D(points)
|
||||
ifc_segements = []
|
||||
ifc_segments = []
|
||||
for segment in segments:
|
||||
segment = [i+1 for i in segment]
|
||||
if len(segment) == 2:
|
||||
ifc_segements.append( ifc_file.createIfcLineIndex( segment ))
|
||||
ifc_segments.append( ifc_file.createIfcLineIndex( segment ))
|
||||
elif len(segment) == 3:
|
||||
ifc_segements.append( ifc_file.createIfcArcIndex( segment ))
|
||||
ifc_segments.append( ifc_file.createIfcArcIndex( segment ))
|
||||
|
||||
ifc_curve = ifc_file.createIfcIndexedPolyCurve(Points=ifc_points, Segments=ifc_segements)
|
||||
ifc_curve = ifc_file.createIfcIndexedPolyCurve(Points=ifc_points, Segments=ifc_segments)
|
||||
|
||||
return (points, segments, ifc_curve)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user