planformcreator2 4.0.0__tar.gz → 4.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/PKG-INFO +4 -8
  2. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/README.md +13 -11
  3. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/doc/README_PyPi.md +2 -2
  4. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/app.py +1 -1
  5. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/app_model.py +54 -9
  6. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/app_modes.py +2 -1
  7. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/model/VLM_wing.py +203 -153
  8. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/model/wing.py +125 -61
  9. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/model/wing_exports.py +74 -6
  10. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/ui/pc2_artists.py +102 -59
  11. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/ui/pc2_diagrams.py +296 -161
  12. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/ui/pc2_dialogs.py +107 -7
  13. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/ui/pc2_panels.py +10 -4
  14. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/pyproject.toml +2 -6
  15. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Amokka.pc2 +2 -37
  16. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Bow.pc2 +2 -27
  17. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Elliptical.pc2 +5 -2
  18. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/F3B_F3F.pc2 +1 -11
  19. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/.gitignore +0 -0
  20. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/LICENSE +0 -0
  21. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/icons/PC2.ico +0 -0
  22. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/icons/PC2_ico.pdn +0 -0
  23. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/PC2_ico.ico +0 -0
  24. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/__init__.py +0 -0
  25. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/__main__.py +0 -0
  26. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/model/VLM.py +0 -0
  27. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/model/__init__.py +0 -0
  28. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/resources.py +0 -0
  29. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/planformcreator2/ui/__init__.py +0 -0
  30. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/ASW_17.png +0 -0
  31. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Scale_Glider.pc2 +0 -0
  32. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Spitfire.png +0 -0
  33. {planformcreator2-4.0.0 → planformcreator2-4.0.2}/templates/Trapezoid.pc2 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: planformcreator2
3
- Version: 4.0.0
3
+ Version: 4.0.2
4
4
  Summary: Design a wing planform
5
5
  Project-URL: Homepage, https://github.com/jxjo/PlanformCreator2
6
6
  Project-URL: Issues, https://github.com/jxjo/PlanformCreator2/issues
@@ -12,17 +12,13 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Python: >=3.12
15
- Requires-Dist: airfoileditor>=4.2.2
15
+ Requires-Dist: airfoileditor>=4.2.5
16
16
  Requires-Dist: ezdxf>=1.4.0
17
- Requires-Dist: numpy~=2.2.0
18
- Requires-Dist: packaging>=24.0
19
- Requires-Dist: pyqt6>=6.9.1
20
- Requires-Dist: pyqtgraph>=0.13.7
21
17
  Description-Content-Type: text/markdown
22
18
 
23
19
  ![PC2](https://github.com/jxjo/PlanformCreator2/blob/main/images/PC2_logo.png?raw=true)
24
20
 
25
- ### Version 4.0
21
+ ### Version 4.0.2
26
22
 
27
23
  ---
28
24
 
@@ -37,7 +33,7 @@ Description-Content-Type: text/markdown
37
33
  * Export planform as dxf file for use in CAD
38
34
 
39
35
  #### Airfoils and Polars
40
- * Define airfoil at wing sections and edit its properties using the [Airfoil Editor](https://github.com/jxjo/AirfoilEditor)
36
+ * Define airfoil at wing sections and edit its properties using the [AirfoilEditor](https://github.com/jxjo/AirfoilEditor)
41
37
  * Generate blended airfoils for intermediate wing sections ('strak')
42
38
  * View polars of the airfoil based on xfoil polar generation
43
39
 
@@ -2,7 +2,7 @@
2
2
  ![PC2](images/PC2_logo.png "Logo")
3
3
 
4
4
 
5
- # v4.0
5
+ # v4.0.2
6
6
 
7
7
  **PlanformCreator2** - short PC2 - is an app to design the planform of a wing focusing on model sailplanes.
8
8
 
@@ -140,6 +140,10 @@ This eliminates the need for manual post-processing of airfoils in CAD.
140
140
 
141
141
  **Note:** The generated planform contour is approximated by many small straight line segments (polyline) and should not be used directly for 3D construction. It is recommended to overlay splines on the leading and trailing edges in your CAD program for smooth surfaces.
142
142
 
143
+ ### Export as CSV File
144
+
145
+ The geometric data of the wing sections, including spanwise position and leading/trailing edge coordinates, can be exported to a CSV file for further processing in apps such as Excel.
146
+
143
147
 
144
148
  ## Airfoils and Polars
145
149
 
@@ -217,7 +221,7 @@ Please read [the short description](doc/PC2_export_to_Xflr5.md) of how it works.
217
221
 
218
222
  PC2 generates a ready to use FLZ_vortex project file which can be loaded as a new 'flight scene' ('Flugszene') or FLZ_vortex can be launched directly from PC2 having the project file loaded. For direct launch the file extension .flz must be assigned to the app FLZ_vortex.
219
223
 
220
- Do not forget to adjust the plane mass before running a calculation.
224
+ Do not forget to adjust the plane mass in FLZ before running a calculation.
221
225
 
222
226
  ### VLM Analysis
223
227
 
@@ -227,9 +231,11 @@ PC2 includes an integrated VLM (Vortex Lattice Method) module to calculate the l
227
231
 
228
232
  The primary objective of aerodynamic analysis in PC2 is to identify wing regions that will stall first when the angle of attack increases. For this assessment, 2D airfoil polar data and 3D lift aerodynamic data are combined in a viscous loop.
229
233
 
230
- The 2D airfoil polar data is taken from the polar definitions described in the previous section. Airfoil polars are evaluated for each wing section. Wing analysis supports only T1 polars (constant speed).
234
+ To obtain 2D airfoil data, additional polars with forced transition close to the leading edge are evaluated. These additional polars enable more accurate determination of alpha0, as they do not exhibit Xfoil artifacts around alpha0 in the cl(alpha) polar.
235
+
236
+ Airfoil polars are evaluated for each wing section. Wing analysis supports only T1 polars (constant speed).
231
237
 
232
- The viscous loop calculates the effective Cl and alpha for each panel station along the span.
238
+ The viscous loop of the VLM analysis calculates the effective Cl and alpha for each panel station along the span.
233
239
 
234
240
  <img src="./images/vlm_viscous_loop.png" width="400" />
235
241
 
@@ -239,7 +245,7 @@ The maximum possible angle of attack (close to stall) is automatically evaluated
239
245
 
240
246
  <sup>Simple wing example showing the critical wing regions where local Cl reaches cl max of the airfoil.</sup>
241
247
 
242
- By activating the chord distribution view, the chord and thus the area in which the wing will fail first can be changed interactively.
248
+ By activating the chord distribution view, the chord and thus the area in which the wing will stall first can be changed interactively.
243
249
 
244
250
  <img src="images/vlm_cl_max_with_chord.png" width="800" />
245
251
 
@@ -343,15 +349,11 @@ If there is warning message like "Failed to create wl_display" when starting the
343
349
 
344
350
  ### Cloning from Github
345
351
 
346
- If you want to clone the AirfoilEditor repo from GitHub for local development, the following package have to be installed in your (virtual) python environment
352
+ If you want to clone the PlanformCreator2 repo from GitHub for local development, the following package have to be installed in your (virtual) python environment
347
353
 
348
354
  ```
349
- pip install packaging
350
- pip install numpy
351
- pip install pyqt6
352
- pip install pyqtgraph
353
- pip install ezdxf
354
355
  pip install airfoileditor
356
+ pip install ezdxf
355
357
  ```
356
358
 
357
359
  ### Changelog
@@ -1,6 +1,6 @@
1
1
  ![PC2](https://github.com/jxjo/PlanformCreator2/blob/main/images/PC2_logo.png?raw=true)
2
2
 
3
- ### Version 4.0
3
+ ### Version 4.0.2
4
4
 
5
5
  ---
6
6
 
@@ -15,7 +15,7 @@
15
15
  * Export planform as dxf file for use in CAD
16
16
 
17
17
  #### Airfoils and Polars
18
- * Define airfoil at wing sections and edit its properties using the [Airfoil Editor](https://github.com/jxjo/AirfoilEditor)
18
+ * Define airfoil at wing sections and edit its properties using the [AirfoilEditor](https://github.com/jxjo/AirfoilEditor)
19
19
  * Generate blended airfoils for intermediate wing sections ('strak')
20
20
  * View polars of the airfoil based on xfoil polar generation
21
21
 
@@ -66,7 +66,7 @@ logger = logging.getLogger(__name__)
66
66
  #-------------------------------------------------------------------------------
67
67
 
68
68
  APP_NAME = "PlanformCreator2"
69
- __version__ = "4.0.0" # hatch "version dynamic" reads this version for build
69
+ __version__ = "4.0.2" # hatch "version dynamic" reads this version for build
70
70
 
71
71
 
72
72
  class Main (QMainWindow):
@@ -236,6 +236,36 @@ class App_Model (QObject):
236
236
  self.sig_wingSection_selected.emit()
237
237
 
238
238
 
239
+ def delete_wingSection (self, aSection : WingSection):
240
+ """ delete a wing section and set new current wing section """
241
+
242
+ new_current = self.wing.planform.wingSections.delete (aSection)
243
+ if new_current:
244
+ logger.debug (f"{aSection} deleted, new current is {new_current}")
245
+ self._cur_wingSection = new_current # silent set
246
+ self.notify_wingSection_changed ()
247
+
248
+
249
+ def create_wingSection (self) -> WingSection:
250
+ """ create and insert a new wing section after current wing section """
251
+
252
+ new_section = self.wing.planform.wingSections.create_after (self.cur_wingSection)
253
+ if new_section:
254
+ logger.debug (f"{new_section} created after {self.cur_wingSection}")
255
+ self._cur_wingSection = new_section # silent set
256
+ self.notify_wingSection_changed ()
257
+
258
+
259
+ def create_wingSection_at (self, pos_x : float) -> WingSection:
260
+ """ create and insert a new wing section at given x position """
261
+
262
+ new_section = self.wing.planform.wingSections.create_at (pos_x)
263
+ if new_section:
264
+ logger.debug (f"{new_section} created at x={pos_x}")
265
+ self._cur_wingSection = new_section # silent set
266
+ self.notify_wingSection_changed ()
267
+
268
+
239
269
  # --- VLM -----
240
270
 
241
271
  @property
@@ -321,12 +351,15 @@ class App_Model (QObject):
321
351
 
322
352
  if aBool: # try to set to max now
323
353
  self._cur_vlm_alpha = self._get_vlm_alpha_max ()
324
- self.sig_vlm_opPoint_changed.emit()
354
+
355
+ self.sig_vlm_opPoint_changed.emit()
325
356
 
326
357
  @property
327
358
  def cur_vlm_opPoint (self) -> VLM_OpPoint:
328
359
  """ current VLM operating point based on alpha """
329
- if self.cur_vlm_polar:
360
+
361
+ # sanity - airfoils must be straked -
362
+ if self.cur_vlm_polar and self.wing.planform.wingSections.strak_done:
330
363
  return self.cur_vlm_polar.opPoint_at (self.cur_vlm_alpha)
331
364
  else:
332
365
  return None
@@ -388,8 +421,20 @@ class App_Model (QObject):
388
421
 
389
422
  def notify_wingSection_changed (self):
390
423
  """ notify self that wing section changed """
391
- self.sig_wingSection_changed.emit()
392
- self.notify_paneling_changed ()
424
+
425
+ # recalc paneled planform - helper sections may have changed
426
+ if self.wing._planform_paneled:
427
+ self.wing.planform_paneled.optimize()
428
+
429
+ if self.wing.planform.chord_defined_by_sections:
430
+ # if wingSections define planform - do master notify
431
+ self.notify_planform_changed ()
432
+
433
+ else:
434
+ # inform diagram
435
+ self.sig_wingSection_changed.emit()
436
+ # just handle new paneling
437
+ self.notify_paneling_changed ()
393
438
 
394
439
 
395
440
  def notify_paneling_changed (self):
@@ -404,6 +449,11 @@ class App_Model (QObject):
404
449
  QTimer.singleShot(0, self.sig_vlm_polar_reset.emit) # notify after current events processed
405
450
 
406
451
 
452
+ def notify_fileName_changed (self):
453
+ """ notify self that file name has changed """
454
+ self.sig_new_wing.emit() # refresh title etc.
455
+
456
+
407
457
  @property
408
458
  def workingDir_default (self) -> str:
409
459
  """ default working directory """
@@ -417,11 +467,6 @@ class App_Model (QObject):
417
467
  else:
418
468
  return self.workingDir_default
419
469
 
420
- @property
421
- def settings (self) -> Parameters:
422
- """ current loaded settings """
423
- return self._settings
424
-
425
470
 
426
471
  def close (self):
427
472
  """ finish app model """
@@ -329,10 +329,11 @@ class Mode_Modify (Mode_Abstract):
329
329
  ok = self.wing.save (newPathFilename = newPathFilename)
330
330
  if ok:
331
331
  self._toast_message (f"Planform saved as {newPathFilename}", toast_style=style.GOOD)
332
+ self.app_model.notify_fileName_changed() # refresh title ...
332
333
  else:
333
334
  MessageBox.error (self.stacked_panel,"Save Planform", f"<b>{newPathFilename}</b> couldn't be saved", min_height= 60)
334
335
 
335
- self.app_model.load_wing (newPathFilename) # reload old wing
336
+ self.app_model.load_wing (newPathFilename) # reload old wing
336
337
  return
337
338
 
338
339