9 Commits

Author SHA1 Message Date
dependabot[bot] ac62d6373a Bump actions/checkout from 4.1.1 to 4.1.6 (#12)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 19:39:13 +01:00
dependabot[bot] b88c956583 Bump specklesystems/speckle-automate-github-composite-action (#7)
Bumps [specklesystems/speckle-automate-github-composite-action](https://github.com/specklesystems/speckle-automate-github-composite-action) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/specklesystems/speckle-automate-github-composite-action/releases)
- [Commits](https://github.com/specklesystems/speckle-automate-github-composite-action/compare/0.8.0...0.8.1)

---
updated-dependencies:
- dependency-name: specklesystems/speckle-automate-github-composite-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-09 12:54:14 +00:00
Jonathon Broughton e2bfdefc6d additional MEP elements
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
2024-02-09 12:32:25 +00:00
Jonathon Broughton ce0299bccf De-optimise from bounding box clashes 2024-02-09 12:31:50 +00:00
Jonathon Broughton 0d2c827297 specklepy updated
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
2024-02-09 09:21:46 +00:00
dependabot[bot] 98c4a119c7 Bump actions/checkout from 3.4.0 to 4.1.1 (#4)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathon Broughton <jonathon@stardotbmp.com>
2024-02-09 08:47:53 +00:00
dependabot[bot] 61cb8d54f5 Bump actions/setup-python from 4 to 5 (#5)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathon Broughton <jonathon@stardotbmp.com>
2024-02-09 08:47:07 +00:00
dependabot[bot] 24400bfb9b Bump specklesystems/speckle-automate-github-composite-action (#6)
Bumps [specklesystems/speckle-automate-github-composite-action](https://github.com/specklesystems/speckle-automate-github-composite-action) from 0.7.4 to 0.8.0.
- [Release notes](https://github.com/specklesystems/speckle-automate-github-composite-action/releases)
- [Commits](https://github.com/specklesystems/speckle-automate-github-composite-action/compare/0.7.4...0.8.0)

---
updated-dependencies:
- dependency-name: specklesystems/speckle-automate-github-composite-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-09 08:46:08 +00:00
Jonathon Broughton 5978a90c72 Update main.yml 2024-02-08 20:58:49 +00:00
5 changed files with 616 additions and 585 deletions
+5 -5
View File
@@ -11,8 +11,8 @@ jobs:
FUNCTION_SCHEMA_FILE_NAME: functionSchema.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.4.0
- uses: actions/setup-python@v4
- uses: actions/checkout@v4.1.6
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install and configure Poetry
@@ -29,12 +29,12 @@ jobs:
run: |
python main.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }}
- name: Speckle Automate Function - Build and Publish
uses: specklesystems/speckle-automate-github-composite-action@0.7.4
uses: specklesystems/speckle-automate-github-composite-action@0.8.1
with:
speckle_automate_url: ${{ env.SPECKLE_AUTOMATE_URL || 'https://automate.speckle.dev' }}
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
speckle_function_id: ${{ secrets.SPECKLE_FUNCTION_ID }}
speckle_function_input_schema_file_path: ${{ env.FUNCTION_SCHEMA_FILE_NAME }}
speckle_function_command: 'python -u main.py run'
speckle_function_recommended_cpu_m: 4000
speckle_function_recommended_memory_mi: 4000
speckle_function_recommended_cpu_m: 8000
speckle_function_recommended_memory_mi: 8000
+8 -3
View File
@@ -88,8 +88,13 @@ def speckle_mesh_to_trimesh(input_mesh: SpeckleMesh) -> trimesh.Trimesh:
t_mesh = trimesh.Trimesh(vertices=vertices, faces=np.array(faces))
obbox = t_mesh.bounding_box_oriented
return t_mesh
obbox_mesh = obbox.to_mesh()
# code below speeds up the process but is not used in the current implementation.
# Bounding boxes could be used for a 2-pass approach to speed up the process.
return obbox_mesh
# obbox = t_mesh.bounding_box_oriented
# obbox_mesh = obbox.to_mesh()
# return obbox_mesh
+24 -16
View File
@@ -2,6 +2,7 @@
use the automation_context module to wrap your function in an Automate context helper
"""
from collections import defaultdict
from typing import Optional
@@ -44,19 +45,22 @@ class FunctionInputs(AutomateBase):
Negative values relaxes the test, positive values make it more strict.",
json_schema_extra={
"readOnly": True,
}
},
)
tolerance_unit: str = Field( # Using the SpecklePy Units enum here
default=Units.mm,
json_schema_extra={"examples": ["mm", "cm", "m"], "readOnly": True},
title="Tolerance Unit",
description="Unit of the tolerance value.",
json_schema_extra={
"examples": ["mm", "cm", "m"],
"readOnly": True
},
)
def automate_function(
automate_context: AutomationContext,
function_inputs: FunctionInputs,
automate_context: AutomationContext,
function_inputs: FunctionInputs,
) -> None:
"""This is an example Speckle Automate function.
@@ -71,10 +75,12 @@ def automate_function(
changed_model_version = automate_context.receive_version()
try:
reference_model_version, reference_model_id, reference_model_version_id = get_reference_model(
automate_context, function_inputs.static_model_name
reference_model_version, reference_model_id, reference_model_version_id = (
get_reference_model(automate_context, function_inputs.static_model_name)
)
print(
f"Reference model id: {reference_model_id}, version id: {reference_model_version_id}"
)
print(f"Reference model id: {reference_model_id}, version id: {reference_model_version_id}")
except Exception as ex:
automate_context.mark_run_failed(status_message=str(ex))
@@ -100,6 +106,8 @@ def automate_function(
"Objects.BuiltElements.Duct",
"Objects.BuiltElements.Duct:Objects.BuiltElements.Revit.RevitDuct",
"Objects.BuiltElements.Duct:Objects.BuiltElements.Revit.RevitDuct:Objects.BuiltElements.Revit.RevitFlexDuct",
"Objects.Other.Revit.RevitInstance:Objects.BuiltElements.Revit.RevitMEPFamilyInstance",
"Objects.BuiltElements.Revit.RevitElementType:Objects.BuiltElements.Revit.RevitSymbolElementType"
]
visible_beams_rule = element_rules.rule_combiner(
@@ -138,20 +146,20 @@ def automate_function(
status_message="Clash detection failed. No objects to compare."
)
return
clashes = detect_and_report_clashes(
reference_mesh_elements, latest_mesh_elements, tolerance, automate_context
)
percentage_reference_objects_clashing = (
len(set([ref_id for ref_id, latest_id in clashes]))
/ len(reference_mesh_elements)
* 100
len(set([ref_id for ref_id, latest_id in clashes]))
/ len(reference_mesh_elements)
* 100
)
percentage_latest_objects_clashing = (
len(set([latest_id for ref_id, latest_id in clashes]))
/ len(latest_mesh_elements)
* 100
len(set([latest_id for ref_id, latest_id in clashes]))
/ len(latest_mesh_elements)
* 100
)
# all clashes count
@@ -177,7 +185,7 @@ def automate_function(
def get_reference_model(
automate_context: AutomationContext, static_model_name: str
automate_context: AutomationContext, static_model_name: str
) -> tuple[Base, Optional[str], Optional[str]]:
# the static reference model will be retrieved from the project using model name stored in the inputs
speckle_client = automate_context.speckle_client
Generated
+578 -560
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7,7 +7,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
specklepy = "2.17.11"
specklepy = "2.17.17"
trimesh = "^4.0.4"
pytest = "^7.4.2"
python-dotenv = "^1.0.0"