@@ -116,7 +116,7 @@ def build_motor(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:
116
116
text += f" dry_mass={ self .parameters ['motors' ]['dry_mass' ]} ,\n "
117
117
text += (
118
118
" center_of_dry_mass_position="
119
- + f"{ self .parameters ['motors' ]['center_of_dry_mass ' ]} ,\n "
119
+ + f"{ self .parameters ['motors' ]['center_of_dry_mass_position ' ]} ,\n "
120
120
)
121
121
text += (
122
122
" dry_inertia="
@@ -138,7 +138,7 @@ def build_motor(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook:
138
138
f" grain_separation={ self .parameters ['motors' ]['grain_separation' ]} ,\n "
139
139
)
140
140
text += f" nozzle_radius={ self .parameters ['motors' ]['nozzle_radius' ]} ,\n "
141
- text += f" burn_time={ self .parameters ['motors' ]['burn_time' ]} ,\n "
141
+ # text += f" burn_time={self.parameters['motors']['burn_time']},\n"
142
142
text += f" nozzle_position={ self .parameters ['motors' ]['nozzle_position' ]} ,\n "
143
143
text += f" throat_radius={ self .parameters ['motors' ]['throat_radius' ]} ,\n "
144
144
text += (
@@ -192,10 +192,9 @@ def build_rocket(self, nb: nbf.v4.new_notebook):
192
192
self .add_surfaces_to_rocket (nb )
193
193
194
194
# add the motor to the rocket
195
- # TODO: kinda needs to fix this
196
195
text = (
197
196
"rocket.add_motor(motor, position= "
198
- + f"{ self .parameters ['rocket ' ]['radius ' ]} )\n "
197
+ + f"{ self .parameters ['motors ' ]['position ' ]} )\n "
199
198
)
200
199
nb ["cells" ].append (nbf .v4 .new_code_cell (text ))
201
200
@@ -225,10 +224,32 @@ def add_surfaces_to_rocket(self, nb: nbf.v4.new_notebook) -> nbf.v4.new_notebook
225
224
text = "### Adding surfaces to the rocket\n "
226
225
text += "Now that we have all the surfaces, we can add them to the rocket\n "
227
226
nb ["cells" ].append (nbf .v4 .new_markdown_cell (text ))
227
+ text = "rocket.add_surfaces("
228
+
229
+ # building surfaces and positions text
230
+ surface_text = "surfaces=["
231
+ position_text = "positions=["
228
232
229
- # add a code cell
230
- text = "rocket.add_surfaces"
233
+ # adding nosecone
234
+ surface_text += "nosecone, "
235
+ position_text += f"{ self .parameters ['nosecones' ]['position' ]} , "
236
+
237
+ # adding trapezoidal
238
+ for i in range (len (self .parameters ["trapezoidal_fins" ])):
239
+ surface_text += f"trapezoidal_fins[{ i } ], "
240
+ position_text += f"{ self .parameters ['trapezoidal_fins' ][str (i )]['position' ]} , "
231
241
242
+ # adding tails
243
+ for i in range (len (self .parameters ["tails" ])):
244
+ surface_text += f"tails[{ i } ], "
245
+ position_text += f"{ self .parameters ['tails' ][str (i )]['position' ]} , "
246
+
247
+ # closing surfaces and positions text
248
+ surface_text = surface_text [:- 2 ] + "]"
249
+ position_text = position_text [:- 2 ] + "]"
250
+ text += surface_text + ", " + position_text + ")"
251
+ nb ["cells" ].append (nbf .v4 .new_code_cell (text ))
252
+ # building trapezoidal fins text
232
253
return nb
233
254
234
255
def build_nosecones (self , nb : nbf .v4 .new_notebook ) -> nbf .v4 .new_notebook :
0 commit comments