-
Notifications
You must be signed in to change notification settings - Fork 12
Fix port cutting z position #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
bf27a11
now using center point instead of z_pos and added edge filleting
billingsley-john 5ec94e5
added type hinting
billingsley-john 854fb54
added port cutter tests
billingsley-john 31b726c
moved point at which filleting is performed
billingsley-john 6880229
Automated autopep8 fixes
7e3f4ee
using solid instead of self.solid
billingsley-john 52f6d32
using solid instead of self.solid
billingsley-john 1dc42ec
resolved conflicts
billingsley-john efcb411
Automated autopep8 fixes
dd4f6e7
updated port arguments
billingsley-john 69641d0
Merge branch 'fix_port_cutting_z_position' of https://github.com/ukae…
billingsley-john db55b43
updated port center points
billingsley-john 4a79d93
changed to pascal style
billingsley-john edd5df2
updated import and docstring orders
billingsley-john c0e804f
added missing docstrings
billingsley-john 057a417
Automated autopep8 fixes
faf577c
now accounting for workplane correctly
billingsley-john 28b1046
Merge branch 'fix_port_cutting_z_position' of https://github.com/ukae…
billingsley-john 3efe6e7
Automated autopep8 fixes
79df4ee
updated test class name
billingsley-john 40fdb4d
Merge branch 'fix_port_cutting_z_position' of https://github.com/ukae…
billingsley-john 071f9dd
now using center_point instead of z_pos
billingsley-john aed1daf
Automated autopep8 fixes
8628034
added workplane geometry test
billingsley-john 6c80984
Automated autopep8 fixes
bd95376
fixed assertion
billingsley-john f2bbc21
Merge branch 'fix_port_cutting_z_position' of https://github.com/ukae…
billingsley-john 0d2497e
added filleting test
billingsley-john e4c9819
added more filleting tests
billingsley-john ee51bb5
added assertion
billingsley-john ce3bdf7
Automated autopep8 fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 49 additions & 12 deletions
61
tests/test_parametric_components/test_PortCutterCircular.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,56 @@ | ||
|
|
||
| import math | ||
| import unittest | ||
|
|
||
| import paramak | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| class TestPortCutterCircular(unittest.TestCase): | ||
|
|
||
| def setUp(self): | ||
| self.test_shape = paramak.PortCutterCircular( | ||
| distance=300, radius=20 | ||
| ) | ||
|
|
||
| def test_default_parameters(self): | ||
| """Checks that the default parameters of a PortCutterCircular are correct.""" | ||
|
|
||
| assert self.test_shape.center_point == (0, 0) | ||
| assert self.test_shape.workplane == "ZY" | ||
| assert self.test_shape.rotation_axis == "Z" | ||
| assert self.test_shape.extrusion_start_offset == 1 | ||
| assert self.test_shape.stp_filename == "PortCutterCircular.stp" | ||
| assert self.test_shape.stl_filename == "PortCutterCircular.stl" | ||
| assert self.test_shape.name == "circular_port_cutter" | ||
| assert self.test_shape.material_tag == "circular_port_cutter_mat" | ||
|
|
||
| def test_creation(self): | ||
| """Creates a circular port cutter using the PortCutterCircular parametric | ||
| component and checks that a cadquery solid is created.""" | ||
|
|
||
| assert self.test_shape.solid is not None | ||
| assert self.test_shape.volume > 1000 | ||
|
|
||
| def test_relative_volume(self): | ||
| """Creates PortCutterCircular shapes and checks that their relative volumes | ||
| are correct.""" | ||
|
|
||
| test_volume = self.test_shape.volume | ||
|
|
||
| self.test_shape.extrusion_start_offset = 20 | ||
| self.test_shape.azimuth_placement_angle = [0, 90, 180, 270] | ||
|
|
||
| assert self.test_shape.volume == pytest.approx(test_volume * 4) | ||
|
|
||
| def test_absolute_volume(self): | ||
| """Creates a PortCutterCircular shape and checks that its volume is correct.""" | ||
|
|
||
| # class test_component(unittest.TestCase): | ||
| # TODO: fix issue 548 | ||
| # def test_creation(self): | ||
| # """Checks a PortCutterCircular creation.""" | ||
| assert self.test_shape.volume == pytest.approx(math.pi * (20**2) * 300) | ||
|
|
||
| # test_component = paramak.PortCutterCircular( | ||
| # distance=3, | ||
| # z_pos=0.25, | ||
| # radius=0.1, | ||
| # azimuth_placement_angle=[0, 45, 90, 180] | ||
| # ) | ||
| self.test_shape.extrusion_start_offset = 20 | ||
| self.test_shape.azimuth_placement_angle = [0, 90, 180, 270] | ||
| self.test_shape.radius = 10 | ||
|
|
||
| # assert test_component.solid is not None | ||
| assert self.test_shape.volume == pytest.approx( | ||
| math.pi * (10**2) * 300 * 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.