From 5c1c6665fba2cd76b75f05c7c9c621461b7518ef Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 1 May 2025 12:27:50 +0200 Subject: aircraft-studio, redux. --- bin/main.ml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bin/main.ml (limited to 'bin/main.ml') diff --git a/bin/main.ml b/bin/main.ml new file mode 100644 index 0000000..0767aa7 --- /dev/null +++ b/bin/main.ml @@ -0,0 +1,36 @@ +(* Main function to plot the coordinates *) + +let airfoil_plot naca_num = + (* let filename = Printf.sprintf "static/airfoil-%s.svg" naca_num in *) + let open Naca in + (* Initialize plplot *) + Plplot.plsdev "xwin"; + (* Plplot.plsfnam filename; *) + Plplot.plinit (); + Plplot.plenv (-0.2) 1.2 (-0.3) 0.3 1 0; + + (* Set the labels *) + let x_label = "relative x" in + let y_label = "y_t" in + let title = + Printf.sprintf "NACA %s Airfoil Thickness Distribution" naca_num + in + Plplot.pllab x_label y_label title; + Naca4.plot_airfoil naca_num ~amt:10 (); + + (* End the plot *) + Plplot.plend () + (* filename *) + +(* let main_page naca_num = *) +(* let file = airfoil_plot naca_num in *) +(* "Hello world!" ^ Printf.sprintf "" file *) + +let () = + airfoil_plot "4412" + (* Dream.run @@ Dream.logger *) + (* @@ Dream.router *) + (* [ *) + (* Dream.get "/" (fun _ -> Dream.html @@ main_page "9412"); *) + (* Dream.get "/static/**" (Dream.static "static"); *) + (* ] *) -- cgit v1.2.3