Skip to content

Commit

Permalink
Updated to v.0.4.3 bug fix with different versions of cq-kit/CadQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgale committed Feb 9, 2024
1 parent f2936ad commit cd35b42
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cqgridfinity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# fmt: off
__project__ = 'cqgridfinity'
__version__ = '0.4.2'
__version__ = '0.4.3'
# fmt: on

VERSION = __project__ + "-" + __version__
Expand Down
2 changes: 1 addition & 1 deletion cqgridfinity/gf_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *


Expand Down
7 changes: 6 additions & 1 deletion cqgridfinity/gf_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 11 additions & 0 deletions tests/test_spacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit cd35b42

Please sign in to comment.