Skip to content

Commit f8f7884

Browse files
committed
bonsai other scripts #5178
1 parent 3318de7 commit f8f7884

12 files changed

Lines changed: 23 additions & 27 deletions

src/bonsai/docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# -- Project information -----------------------------------------------------
3838

39-
project = "BlenderBIM Add-on"
39+
project = "Bonsai"
4040
copyright = "2020-2024 IfcOpenShell Contributors"
4141
author = "IfcOpenShell Contributors"
4242

@@ -89,7 +89,7 @@
8989
html_theme_options = {
9090
"source_repository": "https://github.com/IfcOpenShell/IfcOpenShell/",
9191
"source_branch": "v0.8.0",
92-
"source_directory": "src/blenderbim/docs/",
92+
"source_directory": "src/bonsai/docs/",
9393
"light_css_variables": {
9494
"color-brand-primary": "#39b54a",
9595
"color-brand-content": "#39b54a",
@@ -132,7 +132,7 @@
132132
},
133133
{
134134
"name": "GitHub",
135-
"url": "https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/blenderbim/docs",
135+
"url": "https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.8.0/src/bonsai/docs",
136136
"html": """
137137
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
138138
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>

src/bonsai/scripts/generate_au_library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import bpy
2323
import ifcopenshell
2424
import ifcopenshell.api
25-
import blenderbim.tool as tool
25+
import bonsai.tool as tool
2626

2727

2828
class LibraryGenerator:
@@ -183,7 +183,7 @@ def generate(self):
183183
self.create_type("IfcDoorType", "DEMO1", {"model_body": "Door", "plan_body": "Door-Annotation"})
184184
self.create_type("IfcFurnitureType", "BUNNY", {"model_body": "Bunny", "plan_body": "Bunny-Annotation"})
185185

186-
self.file.write("blenderbim-au-library.ifc")
186+
self.file.write("bonsai-au-library.ifc")
187187

188188
def create_layer_set_type(self, name, data):
189189
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class=data["type"], name=name)

src/bonsai/scripts/generate_demo_library.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import bpy
2020
import ifcopenshell
2121
import ifcopenshell.api
22-
import blenderbim.tool as tool
22+
import bonsai.tool as tool
2323

2424

2525
class LibraryGenerator:
@@ -28,11 +28,9 @@ def generate(self):
2828
ifcopenshell.api.post_listeners = {}
2929

3030
self.file = ifcopenshell.api.run("project.create_file")
31-
self.project = ifcopenshell.api.run(
32-
"root.create_entity", self.file, ifc_class="IfcProject", name="BlenderBIM Demo"
33-
)
31+
self.project = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject", name="Bonsai Demo")
3432
self.library = ifcopenshell.api.run(
35-
"root.create_entity", self.file, ifc_class="IfcProjectLibrary", name="BlenderBIM Demo Library"
33+
"root.create_entity", self.file, ifc_class="IfcProjectLibrary", name="Bonsai Demo Library"
3634
)
3735
ifcopenshell.api.run(
3836
"project.assign_declaration", self.file, definitions=[self.library], relating_context=self.project

src/bonsai/scripts/generate_entourage_library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
import bpy
2121
import ifcopenshell
2222
import ifcopenshell.api
23-
import blenderbim.tool as tool
23+
import bonsai.tool as tool
2424
from pathlib import Path
2525

2626

2727
# When run from Blender
2828
BLEND_DIR = os.path.dirname(bpy.data.filepath)
29-
OUT_PATH = os.path.join(BLEND_DIR, "..", "blenderbim", "bim", "data", "libraries", "IFC4 Entourage Library.ifc")
29+
OUT_PATH = os.path.join(BLEND_DIR, "..", "bonsai", "bim", "data", "libraries", "IFC4 Entourage Library.ifc")
3030

3131

3232
class LibraryGenerator:

src/bonsai/scripts/generate_furniture_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ def create_type(self, ifc_class, name, representations):
19291929

19301930

19311931
if __name__ == "__main__":
1932-
path = Path(__file__).parents[1] / "blenderbim/bim/data/libraries"
1932+
path = Path(__file__).parents[1] / "bonsai/bim/data/libraries"
19331933
LibraryGenerator().generate(
19341934
"Non-structural assets library", output_filename=str(path / "IFC4 Furniture Library.ifc")
19351935
)

src/bonsai/scripts/generate_landscape_library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import random
2323
import ifcopenshell
2424
import ifcopenshell.api
25-
import blenderbim.tool as tool
25+
import bonsai.tool as tool
2626
from math import cos, sin, tan, pi
2727
from pathlib import Path
2828
from itertools import chain
@@ -34,7 +34,7 @@
3434

3535
# When run from Blender
3636
BLEND_DIR = os.path.dirname(bpy.data.filepath)
37-
OUT_PATH = os.path.join(BLEND_DIR, "..", "blenderbim", "bim", "data", "libraries", "IFC4 Landscape Library.ifc")
37+
OUT_PATH = os.path.join(BLEND_DIR, "..", "bonsai", "bim", "data", "libraries", "IFC4 Landscape Library.ifc")
3838

3939
SimpleTreeParams = namedtuple("SimpleTreeParams", "plant_height crown_diameter trunk_diameter")
4040
LowPolyTreeParams = namedtuple(

src/bonsai/scripts/generate_site_library.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import bpy
2020
import ifcopenshell
2121
import ifcopenshell.api
22-
import blenderbim.tool as tool
22+
import bonsai.tool as tool
2323

2424

2525
class LibraryGenerator:
@@ -28,11 +28,9 @@ def generate(self):
2828
ifcopenshell.api.post_listeners = {}
2929

3030
self.file = ifcopenshell.api.run("project.create_file")
31-
self.project = ifcopenshell.api.run(
32-
"root.create_entity", self.file, ifc_class="IfcProject", name="BlenderBIM Demo"
33-
)
31+
self.project = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject", name="Bonsai Demo")
3432
self.library = ifcopenshell.api.run(
35-
"root.create_entity", self.file, ifc_class="IfcProjectLibrary", name="BlenderBIM Demo Library"
33+
"root.create_entity", self.file, ifc_class="IfcProjectLibrary", name="Bonsai Demo Library"
3634
)
3735
ifcopenshell.api.run(
3836
"project.assign_declaration", self.file, definitions=[self.library], relating_context=self.library
@@ -66,7 +64,7 @@ def generate(self):
6664
{"body": "Mobile Crane 50T", "clearance": "Mobile Crane 50T - Clearance"},
6765
)
6866

69-
self.file.write("blenderbim-site-library.ifc")
67+
self.file.write("bonsai-site-library.ifc")
7068

7169
def create_type(self, ifc_class, name, representations):
7270
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class=ifc_class, name=name)

src/bonsai/scripts/generate_steel_profiles_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def create_derived_profile(profile, mirrored=False):
229229

230230

231231
if __name__ == "__main__":
232-
path = Path(__file__).parents[1] / "blenderbim/bim/data/libraries"
232+
path = Path(__file__).parents[1] / "bonsai/bim/data/libraries"
233233
LibraryGenerator().generate(parse_profiles_type="EU", output_filename=str(path / "IFC4 EU Steel.ifc"))
234234
LibraryGenerator().generate(parse_profiles_type="AU", output_filename=str(path / "IFC4 AU Steel.ifc"))
235235
LibraryGenerator().generate(parse_profiles_type="US", output_filename=str(path / "IFC4 US Steel.ifc"))

src/bonsai/scripts/geonodes_modifier_prototype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
import ifcopenshell
21-
import blenderbim.tool as tool
21+
import bonsai.tool as tool
2222

2323
import bpy
2424
import bmesh

src/bonsai/scripts/get_description.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def describe(self):
5555
f.write(json.dumps(self.enum_descriptions, indent=4))
5656

5757
def get_html_sources(self):
58-
html_dir = "/home/dion/Projects/IfcOpenShell/src/blenderbim/descriptions/IFC4_3/RC1/HTML"
58+
html_dir = "/home/dion/Projects/IfcOpenShell/src/bonsai/descriptions/IFC4_3/RC1/HTML"
5959
for filename in Path(html_dir).rglob("*.htm"):
6060
if "lexical" not in str(filename):
6161
continue

0 commit comments

Comments
 (0)