Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHeikens committed Oct 4, 2024
2 parents f1c37ec + 7dfb497 commit 764c998
Show file tree
Hide file tree
Showing 586 changed files with 2,917,940 additions and 8 deletions.
6 changes: 5 additions & 1 deletion abstract/coordinatesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,9 @@ def by_point_main_vector(NewOriginCoordinateSystem: Point, DirectionVectorZ: Vec
def __str__(self):
return f"{__class__.__name__}(Origin = " + f"{self.Origin}, X_axis = {self.Xaxis}, Y_Axis = {self.Y_axis}, Z_Axis = {self.Z_axis})"

from abstract.vector import *
X_Axis = Vector(1,0,0)
Y_Axis = Vector(0,1,0)
Z_Axis = Vector(0,0,1)

CSGlobal = CoordinateSystem(Point(0, 0, 0), X_axis, Y_Axis, Z_Axis)
CSGlobal = CoordinateSystem(Point(0, 0, 0), X_Axis, Y_Axis, Z_Axis)
49 changes: 49 additions & 0 deletions example/Struct4U/Test Frame.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from objects.frame import *
from exchange.struct4U import *


filepath = "C:/Users/mikev/3BM/3BM - 3BM Sharepoint/50_projecten/3_3BM_bouwtechniek/2321 Plan WHSD-locatie Oude-Tonge/71_constructie_advies/2321-5.3 Constructie bedrijfshal V3.xml"

tree = ET.parse(filepath)
root = tree.getroot()

#convert .xml to buildingpy objects.
obj = []

#LoadGrid and create in Speckle
XYZ = XMLImportNodes(tree)

obj = obj + XMLImportGrids(tree, 1000)
obj.append(XMLImportPlates(tree))


#BEAMS
BeamsFrom = root.findall(".//Beams/From_node_number")
BeamsNumber = root.findall(".//Beams/Number")
BeamsTo = root.findall(".//Beams/To_node_number")
BeamsName = root.findall(".//Beams/Profile_number")
BeamsLayer = root.findall(".//Beams/Layer")
BeamsRotation = root.findall(".//Beams/Angle")

#PROFILES
ProfileNumber = root.findall(".//Profiles/Number")
ProfileName = root.findall(".//Profiles/Profile_name")

#BEAMS
for i, j, k, l, m in zip(BeamsFrom, BeamsTo, BeamsName, BeamsNumber, BeamsRotation):
profile_name = ProfileName[int(k.text)-1].text
profile_name = profile_name.split()[0]
if profile_name == None:
print(f"No profile name '{profile_name}' found.")
else:
start = XYZ[1][XYZ[0].index(i.text)]
end = XYZ[1][XYZ[0].index(j.text)]
try:
pf = Frame.by_startpoint_endpoint_profile_shapevector(start, end, profile_name, profile_name + "-" + l.text, Vector2(0,0), float(m.text), BaseSteel, None)
if pf != None:
obj.append(pf)
except Exception as e:
print(f"Could not translate '{profile_name}'.")
print(f"Generated BuildingPy Objects.")

print(obj)
6 changes: 3 additions & 3 deletions geometry/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def __init__(self, origin: Point, x_axis, y_axis, z_axis) -> 'CoordinateSystem':
from abstract.vector import Vector
self.id = generateID()
self.Origin = origin
self.X_axis = Vector.normalize(x_axis)
self.Y_axis = Vector.normalize(y_axis)
self.Z_axis = Vector.normalize(z_axis)
self.X_axis = x_axis
self.Y_axis = y_axis
self.Z_axis = z_axis

@classmethod
def by_origin(coordinate_system, origin: Point) -> 'CoordinateSystem':
Expand Down
3 changes: 1 addition & 2 deletions library/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ def byNameColor(cls, name, color):
M1 = Material()
M1.name = name
M1.color = color
M1.colorint = rgb_to_int(color)
#M1.colorint = rgb_to_int(color)
return M1


#Building Materials
BaseConcrete = Material.byNameColor("Concrete", Color().RGB([192, 192, 192]))
BaseTimber = Material.byNameColor("Timber", Color().RGB([191, 159, 116]))
Expand Down
5 changes: 3 additions & 2 deletions library/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
package_root_directory = file.parents[2]
sys.path.append(str(package_root_directory))

from BuildingPy import CChannelParallelFlange, CChannelSlopedFlange, IShapeParallelFlange, LAngle, Rectangle, RectangleHollowSection, Round, Roundtube, TProfileRounded
from objects.profile import CChannelParallelFlange, CChannelSlopedFlange, IShapeParallelFlange, LAngle, Rectangle, RectangleHollowSection, Round, Roundtube, TProfileRounded
from geometry.curve import PolyCurve
from geometry.geometry2d import PolyCurve2D

# [!not included in BP singlefile - end]
jsonFile = "https://raw.githubusercontent.com/3BMLabs/Project-Ocondat/master/steelprofile.json"
Expand Down Expand Up @@ -128,7 +129,7 @@ def __init__(self, name1, segmented = True):
self.polycurve2d = pc2d2

def justifictionToVector(plycrv2D: PolyCurve2D, XJustifiction, Yjustification, ey=None, ez=None):

# print(XJustifiction)
xval = []
yval = []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Generate bp_single_file

on:
schedule:
- cron: '0 0 * * *'

jobs:
run_python_script:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Execute Python script
run: |
python docs/write_bp_single_file.py
- name: Commit and push if changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
git add bp_single_file.py
git commit -m "Automatically updated bp_single_file.py" || true
git push
40 changes: 40 additions & 0 deletions sandbox/Versie juni 2024/.github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upload Python Package

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
with:
path: 'pypi'
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '${{ matrix.python-version }}'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
cd pypi
python -m build
- name: Publish package
if: matrix.python-version == '3.12'
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
35 changes: 35 additions & 0 deletions sandbox/Versie juni 2024/.github/workflows/update_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update Wiki

on:
schedule:
- cron: '0 0 * * *'

jobs:
update_wiki:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Clone Wiki Repository
run: |
git clone https://github.com/3BMLabs/building.py.wiki.git wiki
- name: Copy Documentation to Wiki
run: |
cp docs/usage/*.md wiki/
- name: Commit and Push Changes to Wiki
env:
MY_WIKI_PAT: ${{ secrets.MY_WIKI_PAT }}
run: |
cd wiki
git add .
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update wiki documentation" || true
git push --set-upstream https://${{ env.MY_WIKI_PAT }}@github.com/3BMLabs/building.py.wiki.git
6 changes: 6 additions & 0 deletions sandbox/Versie juni 2024/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.pyc
*.iml
*.xml
*.xml
.idea
\prive
Loading

0 comments on commit 764c998

Please sign in to comment.