Skip to content
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

Inclusion of Shaft and Propeller classes with tests (basic version) #62

Merged
merged 4 commits into from
Apr 16, 2021

Conversation

ggurioli
Copy link
Contributor

The inclusion of Shaft and Propeller classes has to be viewed as a basic first version of them, based on already developed tools. Actually, the solid shaft is built reading from a file with stored shaft information. The propeller (including shaft) is obtained building on the Shaft and the already existing Blade class. I hope that this predisposition of codes could be useful as a starting point for further and future developments.

bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Show resolved Hide resolved
bladex/shaft.py Show resolved Hide resolved
bladex/shaft.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
bladex/propeller.py Outdated Show resolved Hide resolved
sewed_full_body = sewer.SewedShape()
self.sewed_full_body = sewer.SewedShape()

def generate_propeller_iges(self, propeller_and_shaft, display=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate_iges for the method name (no reason to be redundant with "propeller" since the object itself is called Propeller)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thank you.

Comment on lines 71 to 74
display, start_display, add_menu, add_function_to_menu = init_display()
display.DisplayShape(self.sewed_full_body, update=True)
start_display()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why display when exporting? It looks much better to me have a separate method to display the propeller like>

my_custom_propeller = Propeller(...)
my_custom_propeller.display()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change accordingly, thanks.

start_display()

def generate_propeller_stl(self, propeller_and_shaft, display=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks.

Comment on lines 89 to 92
display, start_display, add_menu, add_function_to_menu = init_display()
display.DisplayShape(self.sewed_full_body, update=True)
start_display()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change accordingly, thanks.

bladex/shaft.py Outdated
self.shaft_path = shaft_path
self.display = display

def generate_shaft_solid(self):
Copy link
Member

@ndem0 ndem0 Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate_solid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks.

bladex/shaft.py Outdated
Comment on lines 43 to 46
if self.display:
display, start_display, add_menu, add_function_to_menu = init_display()
display.DisplayShape(shaft_solid, update=True)
start_display()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change accordingly, thanks.


:param shaft.Shaft shaft: shaft to be added to the propeller
:param blade.Blade blade: blade of the propeller
:param int n_blades: number of blades componing the propeller
:cvar OCC.Core.TopoDS.TopoDS_Solid shaft_solid: solid shaft
:cvar OCC.Core.TopoDS.TopoDS_Shell: propeller with shaft shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing name of the variable


:param string filename: path (with the file extension) where to store
the .stl CAD for the propeller and shaft
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a tab is missing. Please check the doc is properly generated

@@ -8,27 +8,25 @@ class Shaft(object):
"""
Bottom-up parametrized shaft construction.

:param string shaft_path: path of a .iges file with stored shaft information.
:param bool display: if True, then display the shaft. Default value is False.
:cvar string filename: path (with the file extension) of a .iges file with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a param, not only a var

bladex/propeller.py Outdated Show resolved Hide resolved
@ndem0 ndem0 merged commit 7c91106 into mathLab:master Apr 16, 2021
@ndem0 ndem0 mentioned this pull request Apr 16, 2021
@ggurioli ggurioli deleted the propeller_shaft branch May 21, 2021 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants