8
8
class Blade (object ):
9
9
"""
10
10
Bottom-up parametrized blade construction.
11
-
11
+
12
12
Given the following parameters of a propeller blade:
13
13
14
14
- :math:`(X, Y)` coordinates of the blade cylindrical sections after
@@ -778,12 +778,12 @@ def generate_iges(self,
778
778
the name <lower_face_string>.iges. Default value is None
779
779
:param string tip: if string is passed then the method generates
780
780
the blade tip using the BRepOffsetAPI_ThruSections algorithm
781
- in order to close the blade at the tip, then exports the generated
782
- CAD into .iges file holding the name <tip_string>.iges.
781
+ in order to close the blade at the tip, then exports the generated
782
+ CAD into .iges file holding the name <tip_string>.iges.
783
783
Default value is None
784
784
:param string root: if string is passed then the method generates
785
785
the blade root using the BRepOffsetAPI_ThruSections algorithm
786
- in order to close the blade at the root, then exports the generated
786
+ in order to close the blade at the root, then exports the generated
787
787
CAD into .iges file holding the name <tip_string>.iges.
788
788
Default value is None
789
789
:param int max_deg: Define the maximal U degree of generated surface.
@@ -868,7 +868,7 @@ def generate_solid(self,
868
868
errors = None ):
869
869
"""
870
870
Generate a solid blade assembling the upper face, lower face, tip and
871
- root using the BRepBuilderAPI_MakeSolid algorithm.
871
+ root using the BRepBuilderAPI_MakeSolid algorithm.
872
872
This method requires PythonOCC (7.4.0) to be installed.
873
873
874
874
:param int max_deg: Define the maximal U degree of generated surface.
@@ -879,12 +879,11 @@ def generate_solid(self,
879
879
the distances between each discrete point used to construct the
880
880
blade and the nearest point on the CAD that is perpendicular to
881
881
that point. Default value is None
882
- :raises RuntimeError: if the assembling of the solid blade is not
882
+ :raises RuntimeError: if the assembling of the solid blade is not
883
883
completed successfully
884
884
"""
885
- from OCC .Core .IGESControl import IGESControl_Writer
886
885
from OCC .Display .SimpleGui import init_display
887
- from OCC .Core .TopoDS import TopoDS_Shape , TopoDS_Shell
886
+ from OCC .Core .TopoDS import TopoDS_Shell
888
887
import OCC .Core .TopoDS
889
888
890
889
if max_deg <= 0 :
@@ -926,7 +925,7 @@ def generate_solid(self,
926
925
if not solid_maker .IsDone ():
927
926
raise RuntimeError ('Unsuccessful assembling of solid blade' )
928
927
result_solid = solid_maker .Solid ()
929
- return result_solid
928
+ return result_solid
930
929
931
930
def generate_stl_smesh (self , min_length = None , max_length = None , outfile_stl = None ):
932
931
"""
@@ -1012,11 +1011,8 @@ def generate_stl_smesh(self, min_length=None, max_length=None, outfile_stl=None)
1012
1011
# Longest distance between 2 points
1013
1012
an1DHypothesis .SetLength (max_length , True )
1014
1013
# Regular Interpolation
1015
- an1DAlgo = StdMeshers_Regular_1D (1 , 0 , aMeshGen )
1016
1014
# Adding 2D hypothesis and algorithms
1017
1015
# 2D surface mesh -- Triangulations
1018
- a2dHypothseis = StdMeshers_TrianglePreference (2 , 0 , aMeshGen )
1019
- a2dAlgo = StdMeshers_MEFISTO_2D (3 , 0 , aMeshGen )
1020
1016
1021
1017
#Calculate mesh for the topological compound containing the 3 shapes
1022
1018
aMesh .ShapeToMesh (aCompound )
@@ -1040,8 +1036,8 @@ def generate_stl(self, upper_face=None,
1040
1036
lower_face = None ,
1041
1037
tip = None ,
1042
1038
root = None ,
1043
- max_deg = 1 ,
1044
- display = False ,
1039
+ max_deg = 1 ,
1040
+ display = False ,
1045
1041
errors = None ):
1046
1042
"""
1047
1043
Generate and export the .STL files for upper face, lower face, tip
@@ -1057,7 +1053,7 @@ def generate_stl(self, upper_face=None,
1057
1053
the name <lower_face_string>.stl. Default value is None
1058
1054
:param string tip: if string is passed then the method generates
1059
1055
the blade tip using the BRepOffsetAPI_ThruSections algorithm
1060
- in order to close the blade at the tip, then exports the generated
1056
+ in order to close the blade at the tip, then exports the generated
1061
1057
CAD into .stl file holding the name <tip_string>.stl.
1062
1058
Default value is None
1063
1059
:param string root: if string is passed then the method generates
@@ -1080,7 +1076,6 @@ def generate_stl(self, upper_face=None,
1080
1076
airfoils. Also to be able to identify and close the blade tip and root.
1081
1077
"""
1082
1078
1083
- import os
1084
1079
from OCC .Extend .DataExchange import write_stl_file
1085
1080
from OCC .Display .SimpleGui import init_display
1086
1081
0 commit comments