From 14f2979e90930ad11422a9852b21e024d70f9f53 Mon Sep 17 00:00:00 2001 From: obucklin Date: Fri, 12 Jul 2024 11:38:58 +0200 Subject: [PATCH 1/9] made tolerance relative to outline length --- src/compas_timber/design/wall_from_surface.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index ab2005734..d47565829 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -114,6 +114,7 @@ def __init__( self.windows = [] self.beam_dimensions = {} self.joint_overrides = joint_overrides + self.dist_tolerance = 0.01 for key in self.BEAM_CATEGORY_NAMES: self.beam_dimensions[key] = [self.beam_width, self.frame_depth] @@ -180,10 +181,10 @@ def create_model(self): model.add_beam(beam) topologies = [] solver = ConnectionSolver() - found_pairs = solver.find_intersecting_pairs(model.beams, rtree=True, max_distance=0.1) + found_pairs = solver.find_intersecting_pairs(model.beams, rtree=True, max_distance=self.dist_tolerance) for pair in found_pairs: beam_a, beam_b = pair - detected_topo, beam_a, beam_b = solver.find_topology(beam_a, beam_b, max_distance=0.1) + detected_topo, beam_a, beam_b = solver.find_topology(beam_a, beam_b, max_distance=self.dist_tolerance) if not detected_topo == JointTopology.TOPO_UNKNOWN: topologies.append({"detected_topo": detected_topo, "beam_a": beam_a, "beam_b": beam_b}) for rule in self.rules: @@ -275,6 +276,7 @@ def beam_category_names(cls): def parse_loops(self): for loop in self.surface.loops: polyline_points = [] + length = 0.0 for i, edge in enumerate(loop.edges): if not edge.is_line: raise ValueError("function only supprorts polyline edges") @@ -285,17 +287,20 @@ def parse_loops(self): polyline_points.append(edge.start_vertex.point) else: polyline_points.append(edge.end_vertex.point) + length += edge.length polyline_points.append(polyline_points[0]) + offset_dist = length * 0.001 if loop.is_outer: - offset_loop = Polyline(offset_polyline(Polyline(polyline_points), 10, self.normal)) + offset_loop = Polyline(offset_polyline(Polyline(polyline_points), offset_dist, self.normal)) if offset_loop.length > Polyline(polyline_points).length: polyline_points.reverse() self.outer_polyline = Polyline(polyline_points) else: - offset_loop = Polyline(offset_polyline(Polyline(polyline_points), 10, self.normal)) + offset_loop = Polyline(offset_polyline(Polyline(polyline_points), offset_dist, self.normal)) if offset_loop.length < Polyline(polyline_points).length: polyline_points.reverse() self.inner_polylines.append(Polyline(polyline_points)) + self.dist_tolerance = self.outer_polyline.length * 0.00001 def generate_perimeter_elements(self): interior_indices = self.get_interior_segment_indices(self.outer_polyline) @@ -359,20 +364,21 @@ def offset_elements(self, element_loop): element.offset(self.edge_stud_offset) offset_loop.append(element) # self.edges.append(Line(element.centerline[0], element.centerline[1])) + for i, element in enumerate(offset_loop): if self.edge_stud_offset > 0: if element.type != "plate": element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] - start_point = intersection_line_line(element.centerline, element_before.centerline, 0.01)[0] - end_point = intersection_line_line(element.centerline, element_after.centerline, 0.01)[0] + start_point = intersection_line_line(element.centerline, element_before.centerline, self.dist_tolerance)[0] + end_point = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance)[0] if start_point and end_point: element.centerline = Line(start_point, end_point) else: element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] - start_point = intersection_line_line(element.centerline, element_before.centerline, 0.01)[0] - end_point = intersection_line_line(element.centerline, element_after.centerline, 0.01)[0] + start_point = intersection_line_line(element.centerline, element_before.centerline, self.dist_tolerance)[0] + end_point = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance)[0] if start_point and end_point: element.centerline = Line(start_point, end_point) return offset_loop @@ -589,7 +595,7 @@ def process_outlines(self): pts = [] for seg in self.outline.lines: if seg != segment: - pt = intersection_line_segment(ray, seg, 0.01)[0] + pt = intersection_line_segment(ray, seg, self.dist_tolerance)[0] if pt: pts.append(Point(*pt)) if len(pts) > 1: From f3edc54ab11c52938d2c41a788c20e9fc462e99a Mon Sep 17 00:00:00 2001 From: obucklin Date: Fri, 12 Jul 2024 11:41:31 +0200 Subject: [PATCH 2/9] format, lint, changelog --- CHANGELOG.md | 1 + src/compas_timber/design/wall_from_surface.py | 13 +++++++++---- .../components/CT_SurfaceModelOptions/code.py | 2 -- tests/compas_timber/test_btlx.py | 1 - 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a54d6375e..f40d4c2f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * Fixed error in BakeWithBoxMap component. +* Fixed error with tolerances for `SurfaceModel`s modeled in meters. ### Removed diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index d47565829..cfab37f1d 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -311,7 +311,6 @@ def generate_perimeter_elements(self): angle_vectors(segment.direction, self.z_axis, deg=True) < 1 or angle_vectors(segment.direction, self.z_axis, deg=True) > 179 ): - if self.lintel_posts: element.type = "jack_stud" else: @@ -370,14 +369,20 @@ def offset_elements(self, element_loop): if element.type != "plate": element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] - start_point = intersection_line_line(element.centerline, element_before.centerline, self.dist_tolerance)[0] - end_point = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance)[0] + start_point = intersection_line_line( + element.centerline, element_before.centerline, self.dist_tolerance + )[0] + end_point = intersection_line_line( + element.centerline, element_after.centerline, self.dist_tolerance + )[0] if start_point and end_point: element.centerline = Line(start_point, end_point) else: element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] - start_point = intersection_line_line(element.centerline, element_before.centerline, self.dist_tolerance)[0] + start_point = intersection_line_line( + element.centerline, element_before.centerline, self.dist_tolerance + )[0] end_point = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance)[0] if start_point and end_point: element.centerline = Line(start_point, end_point) diff --git a/src/compas_timber/ghpython/components/CT_SurfaceModelOptions/code.py b/src/compas_timber/ghpython/components/CT_SurfaceModelOptions/code.py index 2d80b2552..d96552198 100644 --- a/src/compas_timber/ghpython/components/CT_SurfaceModelOptions/code.py +++ b/src/compas_timber/ghpython/components/CT_SurfaceModelOptions/code.py @@ -2,11 +2,9 @@ class SurfaceModelOptions(component): - def RunScript( self, sheeting_outside, sheeting_inside, lintel_posts, edge_stud_offset, custom_dimensions, joint_overrides ): - if sheeting_outside is not None and not isinstance(sheeting_outside, float): raise TypeError("sheeting_outside expected a float, got: {}".format(type(sheeting_outside))) if sheeting_inside is not None and not isinstance(sheeting_inside, float): diff --git a/tests/compas_timber/test_btlx.py b/tests/compas_timber/test_btlx.py index 28942bb5e..6e97699b5 100644 --- a/tests/compas_timber/test_btlx.py +++ b/tests/compas_timber/test_btlx.py @@ -68,7 +68,6 @@ def test_beam_ref_faces_attribute(mock_beam): def test_beam_ref_edges(mock_beam): - ref_edges_expected = ( Line( Point(x=-48.67193560518159, y=20.35704602012424, z=0.0005429194857271558), From 2514cca27332910ab65443c44f527094093c7c5e Mon Sep 17 00:00:00 2001 From: obucklin Date: Wed, 17 Jul 2024 11:09:37 +0200 Subject: [PATCH 3/9] changelog format lint --- CHANGELOG.md | 7 +- .../CT_SurfaceModelJointOverride/code.py | 106 ++++++++++++++++++ .../CT_SurfaceModelJointOverride/icon.png | Bin 0 -> 1080 bytes .../metadata.json | 20 ++++ .../CT_SurfaceModelOptions/metadata.json | 8 +- 5 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/code.py create mode 100644 src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/icon.png create mode 100644 src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/metadata.json diff --git a/CHANGELOG.md b/CHANGELOG.md index f40d4c2f8..e375633bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* Added `SurfaceModelJointOverride` GH Component + ### Changed +* Fixed missing input parameter in `SurfaceModelOptions` GH Component +* Fixed error with tolerances for `SurfaceModel`s modeled in meters. + + ### Removed @@ -25,7 +31,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * Fixed error in BakeWithBoxMap component. -* Fixed error with tolerances for `SurfaceModel`s modeled in meters. ### Removed diff --git a/src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/code.py b/src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/code.py new file mode 100644 index 000000000..88c2fc498 --- /dev/null +++ b/src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/code.py @@ -0,0 +1,106 @@ +import inspect + +from ghpythonlib.componentbase import executingcomponent as component +from Grasshopper.Kernel.GH_RuntimeMessageLevel import Warning +from System.Windows.Forms import ToolStripMenuItem +from System.Windows.Forms import ToolStripSeparator + +from compas_timber.connections import Joint +from compas_timber.design import CategoryRule +from compas_timber.design import SurfaceModel +from compas_timber.ghpython.ghcomponent_helpers import get_leaf_subclasses +from compas_timber.ghpython.ghcomponent_helpers import manage_dynamic_params +from compas_timber.ghpython.ghcomponent_helpers import rename_gh_output + + +class SurfaceModelJointRule(component): + def __init__(self): + super(SurfaceModelJointRule, self).__init__() + self.cat_a = None + self.cat_b = None + self.classes = {} + for cls in get_leaf_subclasses(Joint): + self.classes[cls.__name__] = cls + + if ghenv.Component.Params.Output[0].NickName == "Rule": + self.joint_type = None + else: + parsed_output = ghenv.Component.Params.Output[0].NickName.split(" ") + self.joint_type = self.classes.get(parsed_output[0]) + if len(parsed_output) > 1: + self.cat_a = parsed_output[1] + if len(parsed_output) > 2: + self.cat_b = parsed_output[2] + + def RunScript(self, *args): + if not self.joint_type: + ghenv.Component.Message = "Select joint type from context menu (right click)" + self.AddRuntimeMessage(Warning, "Select joint type from context menu (right click)") + return None + + else: + ghenv.Component.Message = self.joint_type.__name__ + + kwargs = {} + for i, val in enumerate(args): + if val: + kwargs[self.arg_names()[i + 2]] = val + + return CategoryRule(self.joint_type, self.cat_a, self.cat_b, **kwargs) + + def arg_names(self): + if self.joint_type: + names = inspect.getargspec(self.joint_type.__init__)[0][1:] + else: + names = ["beam_a", "beam_b"] + for i in range(2): + names[i] += " category" + return [name for name in names if (name != "key") and (name != "frame")] + + def AppendAdditionalMenuItems(self, menu): + if not self.RuntimeMessages(Warning): + menu.Items.Add(ToolStripSeparator()) + beam_a_menu = ToolStripMenuItem(self.arg_names()[0]) + menu.Items.Add(beam_a_menu) + for name in SurfaceModel.beam_category_names(): + item = ToolStripMenuItem(name, None, self.on_beam_a_click) + if name == self.cat_a: + item.Checked = True + beam_a_menu.DropDownItems.Add(item) + + beam_b_menu = ToolStripMenuItem(self.arg_names()[1]) + menu.Items.Add(beam_b_menu) + for name in SurfaceModel.beam_category_names(): + item = ToolStripMenuItem(name, None, self.on_beam_b_click) + if name == self.cat_b: + item.Checked = True + beam_b_menu.DropDownItems.Add(item) + menu.Items.Add(ToolStripSeparator()) + for name in self.classes.keys(): + item = menu.Items.Add(name, None, self.on_item_click) + if self.joint_type and name == self.joint_type.__name__: + item.Checked = True + + def output_name(self): + name = self.joint_type.__name__ + if self.cat_a: + name += " {}".format(self.cat_a) + if self.cat_b: + name += " {}".format(self.cat_b) + return name + + def on_beam_a_click(self, sender, event_info): + self.cat_a = sender.Text + rename_gh_output(self.output_name(), 0, ghenv) + ghenv.Component.ExpireSolution(True) + + def on_beam_b_click(self, sender, event_info): + self.cat_b = sender.Text + rename_gh_output(self.output_name(), 0, ghenv) + ghenv.Component.ExpireSolution(True) + + def on_item_click(self, sender, event_info): + self.joint_type = self.classes[str(sender)] + rename_gh_output(self.output_name(), 0, ghenv) + manage_dynamic_params(self.arg_names()[2:], ghenv, rename_count=0, permanent_param_count=0) + ghenv.Component.ExpireSolution(True) diff --git a/src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/icon.png b/src/compas_timber/ghpython/components/CT_SurfaceModelJointOverride/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..adef94214c6487e94347013cc448cb60d991afe2 GIT binary patch literal 1080 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GGLLkg|>2BR01_tI= zo-U3d9-T>l{{OdUUh3fLxUr$J(UIY-3@;m7n8-Qn;o&(Z z7dMY5Cgx7U$Jf`_8Q$4b*!=MR{(60=+C>Knn8n1VrO%l&r!9A`EYHS|A9?1*%}Y4E zzwYm;2QQu+IdI^>2S%{DN~f7JCd>&B4SxLQ#k-_Q;Q~hmIXH>uqdQG}2IMQM52&(W!fJz_D%S<>kgljvY6wsHjvlF)%QI zI7aCfQ^16RqM~()2?+sOI+|$)hNi6D=VzGBefZ|(WggS7r988uqE^h3kN^c1(5FhL zm_%8RGK7U)d%7qoNyc@lD$k-ti+I+@?@xR2`W@qG|2al88@r{24r%~H3F?WA#=f>^ zCBV?);nvn}+wsFLqu!XI$aE=7Wn;YAD6W_iv zO=wO`vS5UH@lY0{38&oSCr?t?TXi+2*8Kh@Dszut-j1Q&+=EA)VWn;HFB3$79NNGz zi{*Fd)hiNRUR?(rnY@}54m&2^zjw3Kc#k84NX_2Zy9*vYlw)Q-3`zz-|20K7=yU4D z?GTvrCn0GEgT@ar{g@*MPM+NP{P*|wiRE&4{zKF;O?N%vX`pP~EjW$Ek*!(B zb?+Po5tVK+y(Ej84+_lU;^EJiW`}DZcm)r=q>yRh9SMnvks2yGXT-z=&nYM<9Qg3~ zIDeb3v{_ST#HJ&x2`9h)+?;M-_y3=4<@1Aoc?-4z6BN|W$O2GcDO}D=q!GA>VIV}pi`(#j3Ys@LzW zdsi=SU-#$afddJpKo@dXn8NJ?C8w;Y9SH~b|NsB*?$6K9`z_ZgI5NVm0H&URqPrV& ztu^+9$L%gP?uu|Xglj&O&8V^GcU6_-yF2@MxhC~wZ_m?HI9dR-9%}!g%!A$H`UfKa z0W(uRFo52=`BWq`z@?d Date: Tue, 27 Aug 2024 10:39:01 +0200 Subject: [PATCH 4/9] Used Tolerance module --- src/compas_timber/design/wall_from_surface.py | 31 +++++++++++-------- .../components/CT_Model_From_Surface/code.py | 14 +++++++-- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index cfab37f1d..2419ee444 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -86,12 +86,14 @@ def __init__( beam_width=None, frame_depth=None, z_axis=None, + tolerance=0.01, sheeting_outside=None, sheeting_inside=None, lintel_posts=True, edge_stud_offset=0.0, custom_dimensions=None, joint_overrides=None, + ): self.surface = surface self.beam_width = beam_width @@ -114,7 +116,7 @@ def __init__( self.windows = [] self.beam_dimensions = {} self.joint_overrides = joint_overrides - self.dist_tolerance = 0.01 + self.dist_tolerance = tolerance.relative for key in self.BEAM_CATEGORY_NAMES: self.beam_dimensions[key] = [self.beam_width, self.frame_depth] @@ -276,7 +278,7 @@ def beam_category_names(cls): def parse_loops(self): for loop in self.surface.loops: polyline_points = [] - length = 0.0 + polyline_length = 0.0 for i, edge in enumerate(loop.edges): if not edge.is_line: raise ValueError("function only supprorts polyline edges") @@ -287,20 +289,20 @@ def parse_loops(self): polyline_points.append(edge.start_vertex.point) else: polyline_points.append(edge.end_vertex.point) - length += edge.length + polyline_length += edge.length polyline_points.append(polyline_points[0]) - offset_dist = length * 0.001 + loop_polyline = Polyline(polyline_points) + offset_dist = self.dist_tolerance * 1000 if loop.is_outer: - offset_loop = Polyline(offset_polyline(Polyline(polyline_points), offset_dist, self.normal)) - if offset_loop.length > Polyline(polyline_points).length: + offset_loop = Polyline(offset_polyline(loop_polyline, offset_dist, self.normal)) + if offset_loop.length > loop_polyline.length: polyline_points.reverse() self.outer_polyline = Polyline(polyline_points) else: - offset_loop = Polyline(offset_polyline(Polyline(polyline_points), offset_dist, self.normal)) - if offset_loop.length < Polyline(polyline_points).length: + offset_loop = Polyline(offset_polyline(loop_polyline, offset_dist, self.normal)) + if offset_loop.length < loop_polyline.length: polyline_points.reverse() self.inner_polylines.append(Polyline(polyline_points)) - self.dist_tolerance = self.outer_polyline.length * 0.00001 def generate_perimeter_elements(self): interior_indices = self.get_interior_segment_indices(self.outer_polyline) @@ -308,8 +310,8 @@ def generate_perimeter_elements(self): element = self.BeamElement(segment, parent=self) if i in interior_indices: if ( - angle_vectors(segment.direction, self.z_axis, deg=True) < 1 - or angle_vectors(segment.direction, self.z_axis, deg=True) > 179 + angle_vectors(segment.direction, self.z_axis, deg=True) < 45 + or angle_vectors(segment.direction, self.z_axis, deg=True) > 135 ): if self.lintel_posts: element.type = "jack_stud" @@ -319,8 +321,8 @@ def generate_perimeter_elements(self): element.type = "header" else: if ( - angle_vectors(segment.direction, self.z_axis, deg=True) < 1 - or angle_vectors(segment.direction, self.z_axis, deg=True) > 179 + angle_vectors(segment.direction, self.z_axis, deg=True) < 45 + or angle_vectors(segment.direction, self.z_axis, deg=True) > 135 ): element.type = "edge_stud" else: @@ -377,6 +379,8 @@ def offset_elements(self, element_loop): )[0] if start_point and end_point: element.centerline = Line(start_point, end_point) + else: + raise ValueError("edges are parallel, no intersection found") else: element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] @@ -550,6 +554,7 @@ def __init__(self, outline, sill_height=None, header_height=None, parent=None): self._length = None self._height = None self._frame = None + self.dist_tolerance = parent.dist_tolerance self.process_outlines() @property diff --git a/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py b/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py index 3d4b8a92c..a50d0e827 100644 --- a/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py +++ b/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py @@ -1,5 +1,6 @@ """Creates a Beam from a LineCurve.""" - +import Rhino +from compas.tolerance import Tolerance from compas.geometry import Brep from compas.scene import Scene from ghpythonlib.componentbase import executingcomponent as component @@ -31,8 +32,17 @@ def RunScript(self, surface, stud_spacing, beam_width, frame_depth, z_axis, opti if not options: options = {} + units = Rhino.RhinoDoc.ActiveDoc.GetUnitSystemName(True, True, True, True) + tol = None + if units == "m": + tol = Tolerance(unit="M", absolute=1e-6, relative=1e-6) + elif units == "cm": + tol = Tolerance(unit="CM", absolute=1e-4, relative=1e-4) + elif units == "mm": + tol = Tolerance(unit="MM", absolute=1e-3, relative=1e-3) + surface_model = SurfaceModel( - Brep.from_native(surface), stud_spacing, beam_width, frame_depth, z_axis, **options + Brep.from_native(surface), stud_spacing, beam_width, frame_depth, z_axis, tol, **options ) debug_info = DebugInfomation() From e85da318e987c6255e0b21fd90a632a6ab6d7eda Mon Sep 17 00:00:00 2001 From: obucklin Date: Fri, 6 Sep 2024 17:16:59 +0200 Subject: [PATCH 5/9] pause --- src/compas_timber/design/wall_from_surface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index 2419ee444..2f1306ba5 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -25,6 +25,7 @@ from compas_timber.design import CategoryRule from compas_timber.elements import Beam from compas_timber.model import TimberModel +from compas.tolerance import Tolerance class SurfaceModel(object): @@ -86,7 +87,7 @@ def __init__( beam_width=None, frame_depth=None, z_axis=None, - tolerance=0.01, + tolerance=Tolerance(unit="MM", absolute=1e-3, relative=1e-3), sheeting_outside=None, sheeting_inside=None, lintel_posts=True, @@ -405,7 +406,7 @@ def generate_studs(self): def generate_stud_lines(self): x_position = self.stud_spacing - while x_position < self.panel_length: + while x_position < self.panel_length - self.beam_width: start_point = Point(x_position, 0, 0) start_point.transform(matrix_from_frame_to_frame(Frame.worldXY(), self.frame)) line = Line.from_point_and_vector(start_point, self.z_axis * self.panel_height) From 4c0a072aa4535ae8992e782dc3e45b98d7d52698 Mon Sep 17 00:00:00 2001 From: obucklin Date: Fri, 6 Sep 2024 17:37:49 +0200 Subject: [PATCH 6/9] fixed it linted formatted --- src/compas_timber/design/wall_from_surface.py | 3 +-- .../ghpython/components/CT_Model_From_Surface/code.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index 2f1306ba5..f5e72132a 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -17,6 +17,7 @@ from compas.geometry import matrix_from_frame_to_frame from compas.geometry import offset_line from compas.geometry import offset_polyline +from compas.tolerance import Tolerance from compas_timber.connections import ConnectionSolver from compas_timber.connections import JointTopology @@ -25,7 +26,6 @@ from compas_timber.design import CategoryRule from compas_timber.elements import Beam from compas_timber.model import TimberModel -from compas.tolerance import Tolerance class SurfaceModel(object): @@ -94,7 +94,6 @@ def __init__( edge_stud_offset=0.0, custom_dimensions=None, joint_overrides=None, - ): self.surface = surface self.beam_width = beam_width diff --git a/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py b/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py index a50d0e827..d455bc0f6 100644 --- a/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py +++ b/src/compas_timber/ghpython/components/CT_Model_From_Surface/code.py @@ -1,8 +1,9 @@ """Creates a Beam from a LineCurve.""" + import Rhino -from compas.tolerance import Tolerance from compas.geometry import Brep from compas.scene import Scene +from compas.tolerance import Tolerance from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel.GH_RuntimeMessageLevel import Warning from Rhino.Geometry import Brep as RhinoBrep From 27f899d792975191842e0e9a1506ee6d91e7b9d2 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Mon, 9 Sep 2024 13:27:37 +0200 Subject: [PATCH 7/9] removed extra empty line in changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e375633bd..ae681bef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed missing input parameter in `SurfaceModelOptions` GH Component * Fixed error with tolerances for `SurfaceModel`s modeled in meters. - ### Removed From fe7fe4bff9e012be2ecca96d512c1ed16cf6a81d Mon Sep 17 00:00:00 2001 From: obucklin Date: Mon, 9 Sep 2024 13:57:29 +0200 Subject: [PATCH 8/9] changed to `point, _` --- src/compas_timber/design/wall_from_surface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compas_timber/design/wall_from_surface.py b/src/compas_timber/design/wall_from_surface.py index f5e72132a..a6ebe4ee4 100644 --- a/src/compas_timber/design/wall_from_surface.py +++ b/src/compas_timber/design/wall_from_surface.py @@ -384,10 +384,10 @@ def offset_elements(self, element_loop): else: element_before = offset_loop[i - 1] element_after = offset_loop[(i + 1) % len(offset_loop)] - start_point = intersection_line_line( + start_point, _ = intersection_line_line( element.centerline, element_before.centerline, self.dist_tolerance - )[0] - end_point = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance)[0] + ) + end_point, _ = intersection_line_line(element.centerline, element_after.centerline, self.dist_tolerance) if start_point and end_point: element.centerline = Line(start_point, end_point) return offset_loop From 059b0c489aaf88d0b9e639ea34aaac6710314966 Mon Sep 17 00:00:00 2001 From: obucklin Date: Mon, 9 Sep 2024 14:52:39 +0200 Subject: [PATCH 9/9] minor changes --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee69c9b01..7aad41246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Removed `add_plate` from `TimberModel`, use `add_element` instead. * Removed `add_wall` from `TimberModel`, use `add_element` instead. - ## [0.9.1] 2024-07-05 ### Added