diff --git a/CHANGELOG.md b/CHANGELOG.md index 894ea75..f8596af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,4 @@ - v.0.4.0 - Added `GridfinityRuggedBox` class and `ruggedbox` console script. Various other improvements. - v.0.4.1 - Fixed docstring in `__init__.py` - v.0.4.2 - Improved script automatic renaming +- v.0.4.3 - Fixed regression bug with using multilevel extrusion functions from cq-kit diff --git a/README.md b/README.md index 12a16dc..e0b8d39 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Assuming these dependencie are installed, you can install **cq-gridfinity** usin $ pip install cqgridfinity ``` -The **cq-gridfinity** package can be installed directly from the source code: +Alternatively, the **cq-gridfinity** package can be installed directly from the source code: ```bash $ git clone https://github.com/michaelgale/cq-gridfinity.git @@ -597,6 +597,7 @@ b1.save_step_file() - v.0.4.0 - Added `GridfinityRuggedBox` class and `ruggedbox` console script. Various other improvements. - v.0.4.1 - Fixed docstring in `__init__.py` - v.0.4.2 - Improved script automatic renaming +- v.0.4.3 - Fixed regression bug with using multilevel extrusion functions from cq-kit # References diff --git a/cqgridfinity/__init__.py b/cqgridfinity/__init__.py index 6b9814e..89db65c 100644 --- a/cqgridfinity/__init__.py +++ b/cqgridfinity/__init__.py @@ -4,7 +4,7 @@ # fmt: off __project__ = 'cqgridfinity' -__version__ = '0.4.2' +__version__ = '0.4.3' # fmt: on VERSION = __project__ + "-" + __version__ diff --git a/cqgridfinity/gf_box.py b/cqgridfinity/gf_box.py index 84f7ad5..ff15f24 100644 --- a/cqgridfinity/gf_box.py +++ b/cqgridfinity/gf_box.py @@ -27,7 +27,7 @@ import cadquery as cq from cqkit import HasZCoordinateSelector, VerticalEdgeSelector, FlatEdgeSelector -from cqkit.cq_helpers import rounded_rect_sketch, composite_from_pts +from cqkit.cq_helpers import rounded_rect_sketch, composite_from_pts, size_3d, recentre from cqgridfinity import * diff --git a/cqgridfinity/gf_obj.py b/cqgridfinity/gf_obj.py index 26c3776..f3883cd 100644 --- a/cqgridfinity/gf_obj.py +++ b/cqgridfinity/gf_obj.py @@ -312,7 +312,12 @@ def extrude_profile(self, sketch, profile, workplane="XY"): taper = profile[0][1] if isinstance(profile[0], (list, tuple)) else 0 p0 = profile[0][0] if isinstance(profile[0], (list, tuple)) else profile[0] r = cq.Workplane(workplane).placeSketch(sketch).extrude(p0, taper=taper) - return multi_extrude(r, profile[1:]) + for level in profile[1:]: + if isinstance(level, (tuple, list)): + r = r.faces(">Z").wires().toPending().extrude(level[0], taper=level[1]) + else: + r = r.faces(">Z").wires().toPending().extrude(level) + return r @classmethod def to_step_file( diff --git a/tests/test_spacer.py b/tests/test_spacer.py index c89e004..052bbd1 100644 --- a/tests/test_spacer.py +++ b/tests/test_spacer.py @@ -92,3 +92,14 @@ def test_spacer_render(): assert s1.filename() == "gf_drawer_4x3_corner_spacer" if _export_files("spacer"): s1.save_step_file(path=EXPORT_STEP_FILE_PATH) + + +# def test_spacer_render(): +# s1 = GridfinityDrawerSpacer(tolerance=0.25) +# dx, dy = INCHES(22 + 7/8)-0.5, INCHES(16 + 3/16)-0.5 +# s1.best_fit_to_dim(dx, dy, verbose=True) +# rh = s1.render_half_set() +# # assert _almost_same(size_3d(rh), (253.084, 177.0625, 5)) +# # assert s1.filename() == "gf_drawer_4x3_half_set" +# # if _export_files("spacer"): +# s1.save_step_file(path=EXPORT_STEP_FILE_PATH)