Skip to content

Commit 28239a3

Browse files
committed
Bindings for custom BSDF definitions added.
1 parent fddab8b commit 28239a3

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

CMakeLists-WinCalc.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include(ExternalProject)
44

55
ExternalProject_Add(wincalc
66
GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git
7-
GIT_TAG "v2.5.2"
7+
GIT_TAG "v2.5.1"
88

99
UPDATE_COMMAND ""
1010
PATCH_COMMAND ""

pywincalc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import deprecation
33

44
from wincalcbindings import (
5-
AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere,
5+
AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFDefinition, BSDFHemisphere,
66
BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow,
77
CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, Layers, CellSpacingType, PolygonType, pillar_cell_area,
88
PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement,
@@ -21,7 +21,7 @@
2121
ProductDataOpticalDualBandBSDF, ProductDataOpticalDualBandHemispheric, ProductDataOpticalNBand,
2222
ProductDataOpticalPerforatedScreen, ProductDataOpticalVenetian, ProductDataOpticalWithMaterial,
2323
ProductDataOpticalWovenShade, ProductDataThermal, ProductGeometry, PropertySimple, RGB, Side,
24-
SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, TarcogSystemType, TarcogEnvironmentType,
24+
SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, TarcogSystemType,
2525
ThermalIRResults, ThmxBoundaryCondition, ThmxBoundaryConditionPolygon, ThmxCMABestWorstOption, ThmxCMAOptions,
2626
ThmxFileContents, ThmxMaterial, ThmxMeshParameters, ThmxPolygon, ThmxPolygonPoint, ThmxRGB, ThmxResult,
2727
ThmxUFactorProjectionResult, ThmxUFactorResults, Trichromatic, VenetianGeometry, WavelengthBSDFs,

src/wincalcbindings.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,20 +1121,26 @@ PYBIND11_MODULE(wincalcbindings, m) {
11211121
.value("HALF", SingleLayerOptics::BSDFBasis::Half)
11221122
.value("FULL", SingleLayerOptics::BSDFBasis::Full);
11231123

1124+
py::class_<SingleLayerOptics::BSDFDefinition>(m, "BSDFDefinition")
1125+
.def(py::init<double, size_t>(),
1126+
py::arg("theta"), py::arg("number_of_phis"))
1127+
.def("theta", &SingleLayerOptics::BSDFDefinition::theta)
1128+
.def("num_of_phis", &SingleLayerOptics::BSDFDefinition::numOfPhis);
1129+
11241130
py::class_<SingleLayerOptics::BSDFHemisphere>(m, "BSDFHemisphere")
11251131
.def_static("create",
11261132
py::overload_cast<SingleLayerOptics::BSDFBasis>(
11271133
&SingleLayerOptics::BSDFHemisphere::create),
11281134
py::arg("bsdf_basis"))
1135+
.def_static("create",
1136+
py::overload_cast<std::vector<SingleLayerOptics::BSDFDefinition> const &>(
1137+
&SingleLayerOptics::BSDFHemisphere::create),
1138+
py::arg("bsdf_definitions"))
11291139
.def("get_directions", &SingleLayerOptics::BSDFHemisphere::getDirections);
11301140

11311141
py::enum_<Tarcog::ISO15099::System>(m, "TarcogSystemType", py::arithmetic())
11321142
.value("U", Tarcog::ISO15099::System::Uvalue)
11331143
.value("SHGC", Tarcog::ISO15099::System::SHGC);
1134-
1135-
py::enum_<Tarcog::ISO15099::Environment>(m, "TarcogEnvironmentType", py::arithmetic())
1136-
.value("Indoor", Tarcog::ISO15099::Environment::Indoor)
1137-
.value("Outdoor", Tarcog::ISO15099::Environment::Outdoor);
11381144

11391145
py::enum_<wincalc::Spectal_Data_Wavelength_Range_Method>(
11401146
m, "SpectalDataWavelengthRangeMethodType", py::arithmetic())
@@ -1250,15 +1256,6 @@ PYBIND11_MODULE(wincalcbindings, m) {
12501256
py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0)
12511257
.def("relative_heat_gain", &wincalc::Glazing_System::relative_heat_gain,
12521258
py::arg("theta") = 0, py::arg("phi") = 0)
1253-
.def("heat_flow",
1254-
&wincalc::Glazing_System::heat_flow,
1255-
py::arg("system_type"), py::arg("environment_type"), py::arg("theta") = 0, py::arg("phi") = 0)
1256-
.def("h",
1257-
&wincalc::Glazing_System::h,
1258-
py::arg("system_type"), py::arg("environment_type"), py::arg("theta") = 0, py::arg("phi") = 0)
1259-
.def("radiosities",
1260-
&wincalc::Glazing_System::radiosities,
1261-
py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0)
12621259
.def("environments",
12631260
py::overload_cast<wincalc::Environments const &>(
12641261
&wincalc::Glazing_System::environments),
@@ -1733,8 +1730,9 @@ PYBIND11_MODULE(wincalcbindings, m) {
17331730

17341731
py::class_<SingleLayerOptics::BSDFDirections>(m, "BSDFDirections")
17351732
.def(py::init<>())
1736-
.def(py::init<std::vector<SingleLayerOptics::BSDFDefinition> const &>(),
1737-
py::arg("definitions"))
1733+
.def(py::init<std::vector<SingleLayerOptics::BSDFDefinition> const &,
1734+
SingleLayerOptics::BSDFDirection>(),
1735+
py::arg("definitions"), py::arg("side"))
17381736
.def("lambda_vector", &SingleLayerOptics::BSDFDirections::lambdaVector)
17391737
.def("profile_angles", &SingleLayerOptics::BSDFDirections::profileAngles)
17401738
.def("lambda_matrix", &SingleLayerOptics::BSDFDirections::lambdaMatrix)

0 commit comments

Comments
 (0)