Skip to content

Commit

Permalink
v.0.4.5 fix for extrusion angle
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgale committed Feb 9, 2024
1 parent 9c8f8c2 commit dd5e8b3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
- v.0.4.2 - Improved script automatic renaming
- v.0.4.3 - Fixed regression bug with using multilevel extrusion functions from cq-kit
- v.0.4.4 - IMPORTANT FIX: generated geometry breaks using CadQuery v.2.4+ due to changes in CadQuery's `extrude` method. This version should work with any CQ version since it detects which CQ extrusion implementation is used at runtime.
- v.0.4.5 - IMPORTANT FIX: fixes error in v.0.4.4 for extrusion angle
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ b1.save_step_file()
- v.0.4.2 - Improved script automatic renaming
- v.0.4.3 - Fixed regression bug with using multilevel extrusion functions from cq-kit
- v.0.4.4 - IMPORTANT FIX: generated geometry breaks using CadQuery v.2.4+ due to changes in CadQuery's `extrude` method. This version should work with any CQ version since it detects which CQ extrusion implementation is used at runtime.
- v.0.4.5 - IMPORTANT FIX: fixes error in v.0.4.4 for extrusion angle

# 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.4'
__version__ = '0.4.5'
# fmt: on

VERSION = __project__ + "-" + __version__
Expand Down
2 changes: 1 addition & 1 deletion cqgridfinity/gf_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def extrude_profile(self, sketch, profile, workplane="XY"):
for level in profile[1:]:
if isinstance(level, (tuple, list)):
zlen = level[0] if ZLEN_FIX else level[0] / SQRT2
r = r.faces(">Z").wires().toPending().extrude(zlen, taper=taper)
r = r.faces(">Z").wires().toPending().extrude(zlen, taper=level[1])
else:
r = r.faces(">Z").wires().toPending().extrude(level)
return r
Expand Down
16 changes: 8 additions & 8 deletions tests/test_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,35 @@ def test_basic_box():
def test_lite_box():
b1 = GridfinityBox(2, 3, 5, lite_style=True)
r = b1.render()
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)
assert _almost_same(size_3d(r), (83.5, 125.5, 38.8))
assert _faces_match(r, ">Z", 1)
assert _faces_match(r, "<Z", 6)
assert _edges_match(r, ">Z", 16)
assert _edges_match(r, "<Z", 48)
assert b1.filename() == "gf_box_lite_2x3x5"
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)


def test_empty_box():
b1 = GridfinityBox(2, 3, 5, holes=True)
r = b1.render()
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)
assert _almost_same(size_3d(r), (83.5, 125.5, 38.8))
assert _faces_match(r, ">Z", 1)
assert _faces_match(r, "<Z", 6)
assert _edges_match(r, ">Z", 16)
assert _edges_match(r, "<Z", 72)
assert b1.filename() == "gf_box_2x3x5_holes"
assert _almost_same(b1.top_ref_height, 7.2)
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)


def test_solid_box():
b1 = GridfinitySolidBox(4, 2, 3)
r = b1.render()
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)
assert _almost_same(size_3d(r), (167.5, 83.5, 24.8))
assert _faces_match(r, ">Z", 1)
assert _faces_match(r, "<Z", 8)
Expand All @@ -68,15 +70,15 @@ def test_solid_box():
assert len(r.edges(FlatEdgeSelector(21)).vals()) == 8
assert b1.filename() == "gf_box_4x2x3_solid"
assert _almost_same(b1.top_ref_height, 21)
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)
b1.solid_ratio = 0.5
assert _almost_same(b1.top_ref_height, 14.1)


def test_divided_box():
b1 = GridfinityBox(3, 3, 3, holes=True, length_div=2, width_div=1)
r = b1.render()
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)
assert _almost_same(size_3d(r), (125.5, 125.5, 24.8))
assert _faces_match(r, ">Z", 1)
assert _faces_match(r, "<Z", 9)
Expand All @@ -85,8 +87,6 @@ def test_divided_box():
assert len(r.faces(FlatFaceSelector(21)).vals()) == 1
assert len(r.edges(FlatEdgeSelector(21)).vals()) == 54
assert b1.filename() == "gf_box_3x3x3_div2x1_holes"
if _export_files("box"):
b1.save_step_file(path=EXPORT_STEP_FILE_PATH)


def test_all_features_box():
Expand Down

0 comments on commit dd5e8b3

Please sign in to comment.