@@ -111,46 +111,23 @@ def __init__(self, filename, radii_list, num_points_top_bottom):
111111
112112
113113 def _build_intersection_cylinder_blade (self ):
114- """
115- Private method that constructs the section lines which are the intersections
116- between the cylinder at a fixed radius and the blade, and the camber points.
117- """
118- # Construction of the section lines between two shapes (in this case the
119- # blade and the lateral face of the cylinder)
120- section_builder = BRepAlgoAPI_Section (self .blade_solid ,
121- self .cylinder_lateral_face , False )
122- # Define and build the parametric 2D curve (pcurve) for the section lines defined above
123- section_builder .ComputePCurveOn2 (True )
124- section_builder .Build ()
125- self .section = section_builder .Shape ()
126- wire_maker = BRepBuilderAPI_MakeWire ()
114+ super ()._build_intersection_cylinder_blade ()
127115 wire_maker_top = BRepBuilderAPI_MakeWire ()
128116 wire_maker_bottom = BRepBuilderAPI_MakeWire ()
129-
130- edgeList = TopTools_ListOfShape ()
131117 edgeList_top = TopTools_ListOfShape ()
132118 edgeList_bottom = TopTools_ListOfShape ()
133- edgeExplorer = TopExp_Explorer (self .section , TopAbs_EDGE )
134119 edgeCount = 0
120+ edgeExplorer = TopExp_Explorer (self .section , TopAbs_EDGE )
135121 while edgeExplorer .More ():
136122 edgeCount = edgeCount + 1 # Numbering from 1 in OCC
137123 edge = edgeExplorer .Current ()
138- edgeList .Append (edge )
139124 if edgeCount % 2 == 1 :
140125 edgeList_top .Append (edge )
141126 else :
142127 edgeList_bottom .Append (edge )
143128 edgeExplorer .Next ()
144129
145- # Total sectional curve
146- wire_maker .Add (edgeList )
147- self .wire = wire_maker .Wire ()
148- self .section_wires_list .append (self .wire )
149- self .curve_adaptor = BRepAdaptor_CompCurve (
150- OCC .Core .TopoDS .topods .Wire (self .wire ))
151- self .total_section_length = GCPnts_AbscissaPoint .Length (
152- self .curve_adaptor )
153- # Top part
130+ # Top part of section
154131 wire_maker_top .Add (edgeList_top )
155132 self .wire_top = wire_maker_top .Wire ()
156133 self .curve_adaptor_top = BRepAdaptor_CompCurve (
@@ -165,6 +142,61 @@ def _build_intersection_cylinder_blade(self):
165142 self .total_section_bottom_length = GCPnts_AbscissaPoint .Length (
166143 self .curve_adaptor_bottom )
167144
145+ # def _build_intersection_cylinder_blade(self):
146+ # """
147+ # Private method that constructs the section lines which are the intersections
148+ # between the cylinder at a fixed radius and the blade, and the camber points.
149+ # """
150+ # # Construction of the section lines between two shapes (in this case the
151+ # # blade and the lateral face of the cylinder)
152+ # section_builder = BRepAlgoAPI_Section(self.blade_solid,
153+ # self.cylinder_lateral_face, False)
154+ # # Define and build the parametric 2D curve (pcurve) for the section lines defined above
155+ # section_builder.ComputePCurveOn2(True)
156+ # section_builder.Build()
157+ # self.section = section_builder.Shape()
158+ # wire_maker = BRepBuilderAPI_MakeWire()
159+ # wire_maker_top = BRepBuilderAPI_MakeWire()
160+ # wire_maker_bottom = BRepBuilderAPI_MakeWire()
161+
162+ # edgeList = TopTools_ListOfShape()
163+ # edgeList_top = TopTools_ListOfShape()
164+ # edgeList_bottom = TopTools_ListOfShape()
165+ # edgeExplorer = TopExp_Explorer(self.section, TopAbs_EDGE)
166+ # edgeCount = 0
167+ # while edgeExplorer.More():
168+ # edgeCount = edgeCount + 1 # Numbering from 1 in OCC
169+ # edge = edgeExplorer.Current()
170+ # edgeList.Append(edge)
171+ # if edgeCount % 2 == 1:
172+ # edgeList_top.Append(edge)
173+ # else:
174+ # edgeList_bottom.Append(edge)
175+ # edgeExplorer.Next()
176+
177+ # # Total sectional curve
178+ # wire_maker.Add(edgeList)
179+ # self.wire = wire_maker.Wire()
180+ # self.section_wires_list.append(self.wire)
181+ # self.curve_adaptor = BRepAdaptor_CompCurve(
182+ # OCC.Core.TopoDS.topods.Wire(self.wire))
183+ # self.total_section_length = GCPnts_AbscissaPoint.Length(
184+ # self.curve_adaptor)
185+ # # Top part
186+ # wire_maker_top.Add(edgeList_top)
187+ # self.wire_top = wire_maker_top.Wire()
188+ # self.curve_adaptor_top = BRepAdaptor_CompCurve(
189+ # OCC.Core.TopoDS.topods.Wire(self.wire_top))
190+ # self.total_section_top_length = GCPnts_AbscissaPoint.Length(
191+ # self.curve_adaptor_top)
192+ # # Bottom part
193+ # wire_maker_bottom.Add(edgeList_bottom)
194+ # self.wire_bottom = wire_maker_bottom.Wire()
195+ # self.curve_adaptor_bottom = BRepAdaptor_CompCurve(
196+ # OCC.Core.TopoDS.topods.Wire(self.wire_bottom))
197+ # self.total_section_bottom_length = GCPnts_AbscissaPoint.Length(
198+ # self.curve_adaptor_bottom)
199+
168200
169201 def _camber_curve (self , radius ):
170202 """
0 commit comments