Alphashapefix2
lets finally fix this error and re-release v0.1.5
test with profilepoints.txt
and
from ntrfc.cascade_case.domain import DomainParameters
import importlib.resources
import numpy as np
import pyvista as pv
import os
profilepoints_file = importlib.resources.files("ntrfc") / "data/turbine_cascade_2/profilepoints.txt"
points = np.loadtxt(profilepoints_file)
pointcloud = pv.PolyData(points)
ans = []
for i in range(0, 100):
turbine_domain = DomainParameters()
turbine_domain.generate_params_by_pointcloud(pointcloud)
ans.append(turbine_domain.alpha)
warn = "" if turbine_domain.alpha < 0.015 else "WARNING"
print(f"{i}" + warn)
# pv.set_jupyter_backend("static")
#
# if os.getenv('DISPLAY') is None:
# pv.start_xvfb() # Start X virtual framebuffer (Xvfb)
#
# plotpath = turbine_domain.plot_domainparas("bla.jpg")
#
import matplotlib.pyplot as plt
import numpy as np
plt.hist(ans, bins=10) # density=False would make counts
plt.ylabel('Count')
plt.xlabel('Alpha')
plt.xlim(0.006,0.016)
plt.grid()
plt.show()
Edited by Malte Nyhuis