From 2d9fa20feee7b036d35ad489374384c30e778825 Mon Sep 17 00:00:00 2001 From: Joseph Kenny Date: Tue, 6 Feb 2024 09:57:57 +0100 Subject: [PATCH 1/3] Update sequencer.py Updating sequencer.py SimpleSequenceGenerator() to work with standard assemblies, and if instanceis TimberAssembly steps are created from beam elements. But if instance is Assembly steps are created from assembly parts --- src/compas_timber/planning/sequencer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compas_timber/planning/sequencer.py b/src/compas_timber/planning/sequencer.py index 49288d4ee..1a80dacae 100644 --- a/src/compas_timber/planning/sequencer.py +++ b/src/compas_timber/planning/sequencer.py @@ -2,6 +2,7 @@ from compas.data import json_dump from compas.data import json_load from compas.geometry import Frame +from compas_timber.assembly import TimberAssembly class Actor(object): @@ -268,7 +269,7 @@ class SimpleSequenceGenerator(object): Parameters ---------- - assembly : :class:`compas_timber.assembly.TimberAssembly` + assembly : :class:`compas_timber.assembly.TimberAssembly` or :class:'compas.datastructures.Assembly' Assembly to be sequenced. Attributes @@ -283,7 +284,11 @@ def __init__(self, assembly): @property def result(self): + if isinstance(self.assembly, TimberAssembly): + parts = self.assembly.beams + else: + parts = self.assembly.parts() plan = BuildingPlan() - for beam in self.assembly.beams: - plan.add_step(Step(element_ids=[beam.key], actor=Actor.HUMAN, location=beam.frame)) + for part in parts: + plan.add_step(Step(element_ids=[part.key], actor=Actor.HUMAN, location=part.frame)) return plan From 4dae00e626d79fb3a9d33de081b29f78b1dcab8b Mon Sep 17 00:00:00 2001 From: Joseph Kenny Date: Tue, 6 Feb 2024 10:15:16 +0100 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5385414c..cb4d2b06b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -* `BeamFromCurve` GH component accepts now referenced Rhino curves, referenced Rhino object IDs and internalized lines. +* `BeamFromCurve` GH component accepts now referenced Rhino curves, referenced Rhino object IDs and internalized lines. +* `SimpleSequenceGenerator` updated to work with `compas.datastructures.assembly` and generates building plan acording to type. ### Removed From 5fe2bbd29101c7831ebaf48faf52aaddc317cd59 Mon Sep 17 00:00:00 2001 From: Joseph Kenny Date: Tue, 6 Feb 2024 14:33:10 +0100 Subject: [PATCH 3/3] Update sequencer.py update annotation to to just compas.datastructures.Assembly --- src/compas_timber/planning/sequencer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compas_timber/planning/sequencer.py b/src/compas_timber/planning/sequencer.py index 1a80dacae..8d17717d4 100644 --- a/src/compas_timber/planning/sequencer.py +++ b/src/compas_timber/planning/sequencer.py @@ -269,7 +269,7 @@ class SimpleSequenceGenerator(object): Parameters ---------- - assembly : :class:`compas_timber.assembly.TimberAssembly` or :class:'compas.datastructures.Assembly' + assembly : :class:'compas.datastructures.Assembly' Assembly to be sequenced. Attributes