diff --git a/.coveragerc b/.coveragerc index 43468a3..32cdb98 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,6 +2,7 @@ exclude_lines = pragma: no cover omit = + *__init__* *tests* show_missing = True diff --git a/README.md b/README.md index 9d4c9c2..3909568 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![Building Package](https://github.com/openalea-incubator/spice/actions/workflows/conda-package-build.yml/badge.svg)](https://github.com/openalea-incubator/spice/actions/workflows/conda-package-build.yml) -[![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![License: CeCILL-C](https://img.shields.io/badge/License--CeCILL-C-blue)](https://cecill.info/licences/Licence_CeCILL_V2-en.html) [![Anaconda-Server Badge](https://anaconda.org/openalea3/openalea.spice/badges/version.svg)](https://anaconda.org/openalea3/openalea.spice) diff --git a/conda/meta.yaml b/conda/meta.yaml index 9d577ae..ff053e6 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -52,6 +52,7 @@ test: - openalea.spice.simulator requires: - openalea.plantgl + - openalea.lpy - pytest source_files: - tests/** diff --git a/examples/python/obj-scene/main.py b/examples/python/obj-scene/main.py index 34c9b62..877d8c4 100644 --- a/examples/python/obj-scene/main.py +++ b/examples/python/obj-scene/main.py @@ -1,9 +1,8 @@ -from datetime import datetime import random -import sys +from datetime import datetime from pathlib import Path -from openalea.spice.libspice_core import * +from openalea.spice import * if __name__ == "__main__": n_samples = 12 @@ -36,7 +35,8 @@ print("Creating Scene..") scene = Scene() scene.loadModel(str(Path.home() / "models/Sponza/sponza.obj")) - scene.addPointLight(Vec3(0, -50, 0), 500, Vec3(1, 1, 1)) + #scene.addPointLight(Vec3(0, -50, 0), 500, Vec3(1, 1, 1)) + scene.addLight() scene.build() print("Done!") diff --git a/src/openalea/spice/configuration.py b/src/openalea/spice/configuration.py index eb85f98..701599c 100644 --- a/src/openalea/spice/configuration.py +++ b/src/openalea/spice/configuration.py @@ -54,7 +54,7 @@ def read_file(self, filepath: Path): Parameters ---------- - filepath: str + filepath: Path Name of the configuration file. """ diff --git a/src/openalea/spice/energy/calculate_energy.py b/src/openalea/spice/energy/calculate_energy.py index 6e2736e..77672ea 100644 --- a/src/openalea/spice/energy/calculate_energy.py +++ b/src/openalea/spice/energy/calculate_energy.py @@ -1,7 +1,7 @@ import os # Objective of this module is counting the number of photon on plant/sensor -# Resultat is located in this directory: ./results +# Result is located in this directory: ./results def write_sensor_energy(n_sim, n_calibration, sensor_list, bands_spectre, filename): diff --git a/src/openalea/spice/energy/correct_energy.py b/src/openalea/spice/energy/correct_energy.py index 813624a..2ec3491 100644 --- a/src/openalea/spice/energy/correct_energy.py +++ b/src/openalea/spice/energy/correct_energy.py @@ -93,13 +93,13 @@ def get_correct_energy_coeff( divided_spectral_range: range The section of the base spectral range used to run the simulation spec_file: str - The link to the file which contains the informations of the + The link to the file which contains the information of the heterogeneity of the spectrum Returns ------- integrals: array - The list of the coefficents of energy's correction + The list of the coefficients of energy's correction """ @@ -161,7 +161,7 @@ def get_points_calibration( return points_calibration -def get_calibaration_coefficient(energies, correction_ratios, points_calibration): +def get_calibration_coefficient(energies, correction_ratios, points_calibration): """ Calculate the coefficients used to calibrate the result of simulation @@ -206,11 +206,11 @@ def get_calibaration_coefficient(energies, correction_ratios, points_calibration return coeff_calibration -def calibrate_captor_energy( +def calibrate_sensor_energy( energies, correction_ratios, points_calibration, coeffs_calibration ): """ - Calibrate the captor energy from photons to Mmol / m2 / s + Calibrate the sensor energy from photons to Mmol / m2 / s Parameters ---------- diff --git a/src/openalea/spice/loader/load_plant.py b/src/openalea/spice/loader/load_plant.py index 1426972..94462d2 100644 --- a/src/openalea/spice/loader/load_plant.py +++ b/src/openalea/spice/loader/load_plant.py @@ -23,7 +23,7 @@ # Data is located in this directory: ./assets -def add_lpy_file_to_scene(scene, filename, t, tr2shmap, anchor, scale_factor): +def add_lpy_file_to_scene(scene, filename, t, tr2shmap, anchor, scale_factor=1): """ Adds the lpy mesh to the photonmapping scene. diff --git a/src/openalea/spice/loader/load_sensor.py b/src/openalea/spice/loader/load_sensor.py index 4eaf904..ecf869a 100644 --- a/src/openalea/spice/loader/load_sensor.py +++ b/src/openalea/spice/loader/load_sensor.py @@ -120,83 +120,85 @@ def initVirtualDiskSensor(self, nor=(0, 0, 0), r=0, sensor_id=0): The id of sensor """ + def createVirtualDisk(self): + """ + Create geometry of circular sensor + + Returns + ------- + vertices: array + The vertices of sensor's geometry + normals: array + The normal vectors of each vertices in sensor's geometry + triangles: array + The triangles of sensor's geometry + + """ + vertices = [] + normals = [] + triangles = [] + + val = 3.14285 / 180 + deltaAngle = 10 + triangleCount = 0 + + vertices.append((self.xSite, self.ySite, self.zSite)) + normals.append((self.xNormal, self.yNormal, self.zNormal)) + + if self.zNormal == 1: + x1 = self.radius * cos(0) + y1 = self.radius * sin(0) + z1 = 0 + else: + x1 = self.radius * cos(0) + y1 = 0 + z1 = self.radius * sin(0) + + vertices.append((x1 + self.xSite, y1 + self.ySite, z1 + self.zSite)) + normals.append((self.xNormal, self.yNormal, self.zNormal)) + + i = 0 + while i < 360: + if self.zNormal == 1: + x2 = self.radius * cos((i + deltaAngle) * val) + y2 = self.radius * sin((i + deltaAngle) * val) + z2 = 0 + else: + x2 = self.radius * cos((i + deltaAngle) * val) + y2 = 0 + z2 = self.radius * sin((i + deltaAngle) * val) + + vertices.append((x2 + self.xSite, y2 + self.ySite, z2 + self.zSite)) + normals.append((self.xNormal, self.yNormal, self.zNormal)) + triangles.append((triangleCount + 1, triangleCount + 2, 0)) + + triangleCount += 1 + i += deltaAngle + + sensor_shape = Shape( + TriangleSet(vertices, triangles, normals), + Material( + name="Sensor", + ambient=Color3(0), + specular=Color3(0), + shininess=1, + transparency=0, + ), + ) + + self.shape = sensor_shape + self.xNormal = nor[0] self.yNormal = nor[1] self.zNormal = nor[2] self.radius = r self.sensor_id = sensor_id - self.createVirtualDisk() + createVirtualDisk() return self - def createVirtualDisk(self): - """ - Create geometry of circular sensor - - Returns - ------- - vertices: array - The vertices of sensor's geometry - normals: array - The normal vectors of each vertices in sensor's geometry - triangles: array - The triangles of sensor's geometry - - """ - vertices = [] - normals = [] - triangles = [] - - val = 3.14285 / 180 - deltaAngle = 10 - triangleCount = 0 - - vertices.append((self.xSite, self.ySite, self.zSite)) - normals.append((self.xNormal, self.yNormal, self.zNormal)) - - if self.zNormal == 1: - x1 = self.radius * cos(0) - y1 = self.radius * sin(0) - z1 = 0 - else: - x1 = self.radius * cos(0) - y1 = 0 - z1 = self.radius * sin(0) - - vertices.append((x1 + self.xSite, y1 + self.ySite, z1 + self.zSite)) - normals.append((self.xNormal, self.yNormal, self.zNormal)) - - i = 0 - while i < 360: - if self.zNormal == 1: - x2 = self.radius * cos((i + deltaAngle) * val) - y2 = self.radius * sin((i + deltaAngle) * val) - z2 = 0 - else: - x2 = self.radius * cos((i + deltaAngle) * val) - y2 = 0 - z2 = self.radius * sin((i + deltaAngle) * val) - - vertices.append((x2 + self.xSite, y2 + self.ySite, z2 + self.zSite)) - normals.append((self.xNormal, self.yNormal, self.zNormal)) - triangles.append((triangleCount + 1, triangleCount + 2, 0)) - - triangleCount += 1 - i += deltaAngle - - sensor_shape = Shape( - TriangleSet(vertices, triangles, normals), - Material( - name="Sensor", - ambient=Color3(0), - specular=Color3(0), - shininess=1, - transparency=0, - ), - ) - self.shape = sensor_shape def equal(self, xSite, ySite, zSite): """ @@ -213,8 +215,7 @@ def equal(self, xSite, ySite, zSite): Returns ------- - True if equal - False if not equal + True if equal else False """ @@ -252,7 +253,7 @@ def getOpticalProperties(self): specular: float The specular trans: float - The tranparency + The transparency roughness: float The roughness diff --git a/src/openalea/spice/simulator.py b/src/openalea/spice/simulator.py index ab4ccc4..12c5026 100644 --- a/src/openalea/spice/simulator.py +++ b/src/openalea/spice/simulator.py @@ -509,7 +509,7 @@ def calculateCalibrationCoefficient( points_calibration_file, self.configuration.DIVIDED_SPECTRAL_RANGE, ) - self.coeffs_calibration = correct_energy.get_calibaration_coefficient( + self.coeffs_calibration = correct_energy.get_calibration_coefficient( self.N_sim_virtual_sensor, self.integrals, self.points_calibration ) return True @@ -626,6 +626,7 @@ def visualizeResults(self, mode="ipython", wavelength_index=0, colormap="jet"): if mode == "ipython": pgl.Viewer.display(self.scene_pgl) + return None elif mode == "oawidgets": from oawidgets.plantgl import PlantGL import k3d @@ -650,6 +651,7 @@ def visualizeResults(self, mode="ipython", wavelength_index=0, colormap="jet"): return plot else: pgl.Viewer.display(self.scene_pgl) + return None def get_photons_per_triangles(self): """ @@ -770,7 +772,7 @@ def r(): ph_sc.add(sh) ph_sc.merge(self.scene_pgl) pgl.Viewer.display(ph_sc) - + return None elif mode == "oawidgets": from oawidgets.plantgl import PlantGL import k3d @@ -1143,6 +1145,8 @@ def setupRender(self, lookfrom=Vec3(0, 0, 0), lookat=Vec3(0, 0, 0), vfov=50.0): The position of the camera. lookat: Vec3 The point where the camera is looking at + vfov: float + The vertical field of view of the camera """ self.configuration.RENDERING = True @@ -1226,6 +1230,8 @@ def initCameraRender(lookfrom=Vec3(0, 0, 0), lookat=Vec3(0, 0, 0), vfov=50.0): The position of the camera. lookat: Vec3 The point where the camera is looking at + vfov: float + The vertical field of view of the camera Returns ------- diff --git a/tests/PO/Env/ReflectancesMean/Aquanappe.csv b/tests/data/PO/Env/ReflectancesMean/Aquanappe.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/Aquanappe.csv rename to tests/data/PO/Env/ReflectancesMean/Aquanappe.csv diff --git a/tests/PO/Env/ReflectancesMean/CentrePlafond.csv b/tests/data/PO/Env/ReflectancesMean/CentrePlafond.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/CentrePlafond.csv rename to tests/data/PO/Env/ReflectancesMean/CentrePlafond.csv diff --git a/tests/PO/Env/ReflectancesMean/CorniereAlu.csv b/tests/data/PO/Env/ReflectancesMean/CorniereAlu.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/CorniereAlu.csv rename to tests/data/PO/Env/ReflectancesMean/CorniereAlu.csv diff --git a/tests/PO/Env/ReflectancesMean/Makrolon.csv b/tests/data/PO/Env/ReflectancesMean/Makrolon.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/Makrolon.csv rename to tests/data/PO/Env/ReflectancesMean/Makrolon.csv diff --git a/tests/PO/Env/ReflectancesMean/MiroirCaissonLampes.csv b/tests/data/PO/Env/ReflectancesMean/MiroirCaissonLampes.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/MiroirCaissonLampes.csv rename to tests/data/PO/Env/ReflectancesMean/MiroirCaissonLampes.csv diff --git a/tests/PO/Env/ReflectancesMean/MurBlanc.csv b/tests/data/PO/Env/ReflectancesMean/MurBlanc.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/MurBlanc.csv rename to tests/data/PO/Env/ReflectancesMean/MurBlanc.csv diff --git a/tests/PO/Env/ReflectancesMean/MurMetal.csv b/tests/data/PO/Env/ReflectancesMean/MurMetal.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/MurMetal.csv rename to tests/data/PO/Env/ReflectancesMean/MurMetal.csv diff --git a/tests/PO/Env/ReflectancesMean/MurMetalTrou.csv b/tests/data/PO/Env/ReflectancesMean/MurMetalTrou.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/MurMetalTrou.csv rename to tests/data/PO/Env/ReflectancesMean/MurMetalTrou.csv diff --git a/tests/PO/Env/ReflectancesMean/PiedsTablette.csv b/tests/data/PO/Env/ReflectancesMean/PiedsTablette.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/PiedsTablette.csv rename to tests/data/PO/Env/ReflectancesMean/PiedsTablette.csv diff --git a/tests/PO/Env/ReflectancesMean/Sol.csv b/tests/data/PO/Env/ReflectancesMean/Sol.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/Sol.csv rename to tests/data/PO/Env/ReflectancesMean/Sol.csv diff --git a/tests/PO/Env/ReflectancesMean/SousBasstMiroirsVerticaux.csv b/tests/data/PO/Env/ReflectancesMean/SousBasstMiroirsVerticaux.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/SousBasstMiroirsVerticaux.csv rename to tests/data/PO/Env/ReflectancesMean/SousBasstMiroirsVerticaux.csv diff --git a/tests/PO/Env/ReflectancesMean/pot.csv b/tests/data/PO/Env/ReflectancesMean/pot.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/pot.csv rename to tests/data/PO/Env/ReflectancesMean/pot.csv diff --git a/tests/PO/Env/ReflectancesMean/spectralon.csv b/tests/data/PO/Env/ReflectancesMean/spectralon.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/spectralon.csv rename to tests/data/PO/Env/ReflectancesMean/spectralon.csv diff --git a/tests/PO/Env/ReflectancesMean/substrat.csv b/tests/data/PO/Env/ReflectancesMean/substrat.csv similarity index 100% rename from tests/PO/Env/ReflectancesMean/substrat.csv rename to tests/data/PO/Env/ReflectancesMean/substrat.csv diff --git a/tests/PO/Env/TransmittancesMean/Makrolon.csv b/tests/data/PO/Env/TransmittancesMean/Makrolon.csv similarity index 100% rename from tests/PO/Env/TransmittancesMean/Makrolon.csv rename to tests/data/PO/Env/TransmittancesMean/Makrolon.csv diff --git a/tests/PO/Plant/ReflectancesMean/FeuilleVieille_Inf.csv b/tests/data/PO/Plant/ReflectancesMean/FeuilleVieille_Inf.csv similarity index 100% rename from tests/PO/Plant/ReflectancesMean/FeuilleVieille_Inf.csv rename to tests/data/PO/Plant/ReflectancesMean/FeuilleVieille_Inf.csv diff --git a/tests/PO/Plant/ReflectancesMean/FeuilleVieille_Sup.csv b/tests/data/PO/Plant/ReflectancesMean/FeuilleVieille_Sup.csv similarity index 100% rename from tests/PO/Plant/ReflectancesMean/FeuilleVieille_Sup.csv rename to tests/data/PO/Plant/ReflectancesMean/FeuilleVieille_Sup.csv diff --git a/tests/PO/Plant/TransmittancesMean/FeuilleVieille_Inf.csv b/tests/data/PO/Plant/TransmittancesMean/FeuilleVieille_Inf.csv similarity index 100% rename from tests/PO/Plant/TransmittancesMean/FeuilleVieille_Inf.csv rename to tests/data/PO/Plant/TransmittancesMean/FeuilleVieille_Inf.csv diff --git a/tests/PO/Plant/TransmittancesMean/FeuilleVieille_Sup.csv b/tests/data/PO/Plant/TransmittancesMean/FeuilleVieille_Sup.csv similarity index 100% rename from tests/PO/Plant/TransmittancesMean/FeuilleVieille_Sup.csv rename to tests/data/PO/Plant/TransmittancesMean/FeuilleVieille_Sup.csv diff --git a/tests/PO/Specularities.xlsx b/tests/data/PO/Specularities.xlsx similarity index 100% rename from tests/PO/Specularities.xlsx rename to tests/data/PO/Specularities.xlsx diff --git a/tests/data/assets/captors_expe1.csv b/tests/data/assets/captors_expe1.csv new file mode 100644 index 0000000..1b1ce42 --- /dev/null +++ b/tests/data/assets/captors_expe1.csv @@ -0,0 +1,361 @@ +X,Y,Z,rayon_capteur,Xnorm,Ynorm,Znorm +110,930,1000,10,0,0,1 +210,930,1000,10,0,0,1 +310,930,1000,10,0,0,1 +410,930,1000,10,0,0,1 +510,930,1000,10,0,0,1 +610,930,1000,10,0,0,1 +710,930,1000,10,0,0,1 +810,930,1000,10,0,0,1 +910,930,1000,10,0,0,1 +1010,930,1000,10,0,0,1 +1110,930,1000,10,0,0,1 +1210,930,1000,10,0,0,1 +110,1030,1000,10,0,0,1 +210,1030,1000,10,0,0,1 +310,1030,1000,10,0,0,1 +410,1030,1000,10,0,0,1 +510,1030,1000,10,0,0,1 +610,1030,1000,10,0,0,1 +710,1030,1000,10,0,0,1 +810,1030,1000,10,0,0,1 +910,1030,1000,10,0,0,1 +1010,1030,1000,10,0,0,1 +1110,1030,1000,10,0,0,1 +1210,1030,1000,10,0,0,1 +110,1130,1000,10,0,0,1 +210,1130,1000,10,0,0,1 +310,1130,1000,10,0,0,1 +410,1130,1000,10,0,0,1 +510,1130,1000,10,0,0,1 +610,1130,1000,10,0,0,1 +710,1130,1000,10,0,0,1 +810,1130,1000,10,0,0,1 +910,1130,1000,10,0,0,1 +1010,1130,1000,10,0,0,1 +1110,1130,1000,10,0,0,1 +1210,1130,1000,10,0,0,1 +110,1230,1000,10,0,0,1 +210,1230,1000,10,0,0,1 +310,1230,1000,10,0,0,1 +410,1230,1000,10,0,0,1 +510,1230,1000,10,0,0,1 +610,1230,1000,10,0,0,1 +710,1230,1000,10,0,0,1 +810,1230,1000,10,0,0,1 +910,1230,1000,10,0,0,1 +1010,1230,1000,10,0,0,1 +1110,1230,1000,10,0,0,1 +1210,1230,1000,10,0,0,1 +110,1330,1000,10,0,0,1 +210,1330,1000,10,0,0,1 +310,1330,1000,10,0,0,1 +410,1330,1000,10,0,0,1 +510,1330,1000,10,0,0,1 +610,1330,1000,10,0,0,1 +710,1330,1000,10,0,0,1 +810,1330,1000,10,0,0,1 +910,1330,1000,10,0,0,1 +1010,1330,1000,10,0,0,1 +1110,1330,1000,10,0,0,1 +1210,1330,1000,10,0,0,1 +110,1430,1000,10,0,0,1 +210,1430,1000,10,0,0,1 +310,1430,1000,10,0,0,1 +410,1430,1000,10,0,0,1 +510,1430,1000,10,0,0,1 +610,1430,1000,10,0,0,1 +710,1430,1000,10,0,0,1 +810,1430,1000,10,0,0,1 +910,1430,1000,10,0,0,1 +1010,1430,1000,10,0,0,1 +1110,1430,1000,10,0,0,1 +1210,1430,1000,10,0,0,1 +110,1530,1000,10,0,0,1 +210,1530,1000,10,0,0,1 +310,1530,1000,10,0,0,1 +410,1530,1000,10,0,0,1 +510,1530,1000,10,0,0,1 +610,1530,1000,10,0,0,1 +710,1530,1000,10,0,0,1 +810,1530,1000,10,0,0,1 +910,1530,1000,10,0,0,1 +1010,1530,1000,10,0,0,1 +1110,1530,1000,10,0,0,1 +1210,1530,1000,10,0,0,1 +110,1630,1000,10,0,0,1 +210,1630,1000,10,0,0,1 +310,1630,1000,10,0,0,1 +410,1630,1000,10,0,0,1 +510,1630,1000,10,0,0,1 +610,1630,1000,10,0,0,1 +710,1630,1000,10,0,0,1 +810,1630,1000,10,0,0,1 +910,1630,1000,10,0,0,1 +1010,1630,1000,10,0,0,1 +1110,1630,1000,10,0,0,1 +1210,1630,1000,10,0,0,1 +110,1730,1000,10,0,0,1 +210,1730,1000,10,0,0,1 +310,1730,1000,10,0,0,1 +410,1730,1000,10,0,0,1 +510,1730,1000,10,0,0,1 +610,1730,1000,10,0,0,1 +710,1730,1000,10,0,0,1 +810,1730,1000,10,0,0,1 +910,1730,1000,10,0,0,1 +1010,1730,1000,10,0,0,1 +1110,1730,1000,10,0,0,1 +1210,1730,1000,10,0,0,1 +110,1830,1000,10,0,0,1 +210,1830,1000,10,0,0,1 +310,1830,1000,10,0,0,1 +410,1830,1000,10,0,0,1 +510,1830,1000,10,0,0,1 +610,1830,1000,10,0,0,1 +710,1830,1000,10,0,0,1 +810,1830,1000,10,0,0,1 +910,1830,1000,10,0,0,1 +1010,1830,1000,10,0,0,1 +1110,1830,1000,10,0,0,1 +1210,1830,1000,10,0,0,1 +110,930,1400,10,0,0,1 +210,930,1400,10,0,0,1 +310,930,1400,10,0,0,1 +410,930,1400,10,0,0,1 +510,930,1400,10,0,0,1 +610,930,1400,10,0,0,1 +710,930,1400,10,0,0,1 +810,930,1400,10,0,0,1 +910,930,1400,10,0,0,1 +1010,930,1400,10,0,0,1 +1110,930,1400,10,0,0,1 +1210,930,1400,10,0,0,1 +110,1030,1400,10,0,0,1 +210,1030,1400,10,0,0,1 +310,1030,1400,10,0,0,1 +410,1030,1400,10,0,0,1 +510,1030,1400,10,0,0,1 +610,1030,1400,10,0,0,1 +710,1030,1400,10,0,0,1 +810,1030,1400,10,0,0,1 +910,1030,1400,10,0,0,1 +1010,1030,1400,10,0,0,1 +1110,1030,1400,10,0,0,1 +1210,1030,1400,10,0,0,1 +110,1130,1400,10,0,0,1 +210,1130,1400,10,0,0,1 +310,1130,1400,10,0,0,1 +410,1130,1400,10,0,0,1 +510,1130,1400,10,0,0,1 +610,1130,1400,10,0,0,1 +710,1130,1400,10,0,0,1 +810,1130,1400,10,0,0,1 +910,1130,1400,10,0,0,1 +1010,1130,1400,10,0,0,1 +1110,1130,1400,10,0,0,1 +1210,1130,1400,10,0,0,1 +110,1230,1400,10,0,0,1 +210,1230,1400,10,0,0,1 +310,1230,1400,10,0,0,1 +410,1230,1400,10,0,0,1 +510,1230,1400,10,0,0,1 +610,1230,1400,10,0,0,1 +710,1230,1400,10,0,0,1 +810,1230,1400,10,0,0,1 +910,1230,1400,10,0,0,1 +1010,1230,1400,10,0,0,1 +1110,1230,1400,10,0,0,1 +1210,1230,1400,10,0,0,1 +110,1330,1400,10,0,0,1 +210,1330,1400,10,0,0,1 +310,1330,1400,10,0,0,1 +410,1330,1400,10,0,0,1 +510,1330,1400,10,0,0,1 +610,1330,1400,10,0,0,1 +710,1330,1400,10,0,0,1 +810,1330,1400,10,0,0,1 +910,1330,1400,10,0,0,1 +1010,1330,1400,10,0,0,1 +1110,1330,1400,10,0,0,1 +1210,1330,1400,10,0,0,1 +110,1430,1400,10,0,0,1 +210,1430,1400,10,0,0,1 +310,1430,1400,10,0,0,1 +410,1430,1400,10,0,0,1 +510,1430,1400,10,0,0,1 +610,1430,1400,10,0,0,1 +710,1430,1400,10,0,0,1 +810,1430,1400,10,0,0,1 +910,1430,1400,10,0,0,1 +1010,1430,1400,10,0,0,1 +1110,1430,1400,10,0,0,1 +1210,1430,1400,10,0,0,1 +110,1530,1400,10,0,0,1 +210,1530,1400,10,0,0,1 +310,1530,1400,10,0,0,1 +410,1530,1400,10,0,0,1 +510,1530,1400,10,0,0,1 +610,1530,1400,10,0,0,1 +710,1530,1400,10,0,0,1 +810,1530,1400,10,0,0,1 +910,1530,1400,10,0,0,1 +1010,1530,1400,10,0,0,1 +1110,1530,1400,10,0,0,1 +1210,1530,1400,10,0,0,1 +110,1630,1400,10,0,0,1 +210,1630,1400,10,0,0,1 +310,1630,1400,10,0,0,1 +410,1630,1400,10,0,0,1 +510,1630,1400,10,0,0,1 +610,1630,1400,10,0,0,1 +710,1630,1400,10,0,0,1 +810,1630,1400,10,0,0,1 +910,1630,1400,10,0,0,1 +1010,1630,1400,10,0,0,1 +1110,1630,1400,10,0,0,1 +1210,1630,1400,10,0,0,1 +110,1730,1400,10,0,0,1 +210,1730,1400,10,0,0,1 +310,1730,1400,10,0,0,1 +410,1730,1400,10,0,0,1 +510,1730,1400,10,0,0,1 +610,1730,1400,10,0,0,1 +710,1730,1400,10,0,0,1 +810,1730,1400,10,0,0,1 +910,1730,1400,10,0,0,1 +1010,1730,1400,10,0,0,1 +1110,1730,1400,10,0,0,1 +1210,1730,1400,10,0,0,1 +110,1830,1400,10,0,0,1 +210,1830,1400,10,0,0,1 +310,1830,1400,10,0,0,1 +410,1830,1400,10,0,0,1 +510,1830,1400,10,0,0,1 +610,1830,1400,10,0,0,1 +710,1830,1400,10,0,0,1 +810,1830,1400,10,0,0,1 +910,1830,1400,10,0,0,1 +1010,1830,1400,10,0,0,1 +1110,1830,1400,10,0,0,1 +1210,1830,1400,10,0,0,1 +110,930,1800,10,0,0,1 +210,930,1800,10,0,0,1 +310,930,1800,10,0,0,1 +410,930,1800,10,0,0,1 +510,930,1800,10,0,0,1 +610,930,1800,10,0,0,1 +710,930,1800,10,0,0,1 +810,930,1800,10,0,0,1 +910,930,1800,10,0,0,1 +1010,930,1800,10,0,0,1 +1110,930,1800,10,0,0,1 +1210,930,1800,10,0,0,1 +110,1030,1800,10,0,0,1 +210,1030,1800,10,0,0,1 +310,1030,1800,10,0,0,1 +410,1030,1800,10,0,0,1 +510,1030,1800,10,0,0,1 +610,1030,1800,10,0,0,1 +710,1030,1800,10,0,0,1 +810,1030,1800,10,0,0,1 +910,1030,1800,10,0,0,1 +1010,1030,1800,10,0,0,1 +1110,1030,1800,10,0,0,1 +1210,1030,1800,10,0,0,1 +110,1130,1800,10,0,0,1 +210,1130,1800,10,0,0,1 +310,1130,1800,10,0,0,1 +410,1130,1800,10,0,0,1 +510,1130,1800,10,0,0,1 +610,1130,1800,10,0,0,1 +710,1130,1800,10,0,0,1 +810,1130,1800,10,0,0,1 +910,1130,1800,10,0,0,1 +1010,1130,1800,10,0,0,1 +1110,1130,1800,10,0,0,1 +1210,1130,1800,10,0,0,1 +110,1230,1800,10,0,0,1 +210,1230,1800,10,0,0,1 +310,1230,1800,10,0,0,1 +410,1230,1800,10,0,0,1 +510,1230,1800,10,0,0,1 +610,1230,1800,10,0,0,1 +710,1230,1800,10,0,0,1 +810,1230,1800,10,0,0,1 +910,1230,1800,10,0,0,1 +1010,1230,1800,10,0,0,1 +1110,1230,1800,10,0,0,1 +1210,1230,1800,10,0,0,1 +110,1330,1800,10,0,0,1 +210,1330,1800,10,0,0,1 +310,1330,1800,10,0,0,1 +410,1330,1800,10,0,0,1 +510,1330,1800,10,0,0,1 +610,1330,1800,10,0,0,1 +710,1330,1800,10,0,0,1 +810,1330,1800,10,0,0,1 +910,1330,1800,10,0,0,1 +1010,1330,1800,10,0,0,1 +1110,1330,1800,10,0,0,1 +1210,1330,1800,10,0,0,1 +110,1430,1800,10,0,0,1 +210,1430,1800,10,0,0,1 +310,1430,1800,10,0,0,1 +410,1430,1800,10,0,0,1 +510,1430,1800,10,0,0,1 +610,1430,1800,10,0,0,1 +710,1430,1800,10,0,0,1 +810,1430,1800,10,0,0,1 +910,1430,1800,10,0,0,1 +1010,1430,1800,10,0,0,1 +1110,1430,1800,10,0,0,1 +1210,1430,1800,10,0,0,1 +110,1530,1800,10,0,0,1 +210,1530,1800,10,0,0,1 +310,1530,1800,10,0,0,1 +410,1530,1800,10,0,0,1 +510,1530,1800,10,0,0,1 +610,1530,1800,10,0,0,1 +710,1530,1800,10,0,0,1 +810,1530,1800,10,0,0,1 +910,1530,1800,10,0,0,1 +1010,1530,1800,10,0,0,1 +1110,1530,1800,10,0,0,1 +1210,1530,1800,10,0,0,1 +110,1630,1800,10,0,0,1 +210,1630,1800,10,0,0,1 +310,1630,1800,10,0,0,1 +410,1630,1800,10,0,0,1 +510,1630,1800,10,0,0,1 +610,1630,1800,10,0,0,1 +710,1630,1800,10,0,0,1 +810,1630,1800,10,0,0,1 +910,1630,1800,10,0,0,1 +1010,1630,1800,10,0,0,1 +1110,1630,1800,10,0,0,1 +1210,1630,1800,10,0,0,1 +110,1730,1800,10,0,0,1 +210,1730,1800,10,0,0,1 +310,1730,1800,10,0,0,1 +410,1730,1800,10,0,0,1 +510,1730,1800,10,0,0,1 +610,1730,1800,10,0,0,1 +710,1730,1800,10,0,0,1 +810,1730,1800,10,0,0,1 +910,1730,1800,10,0,0,1 +1010,1730,1800,10,0,0,1 +1110,1730,1800,10,0,0,1 +1210,1730,1800,10,0,0,1 +110,1830,1800,10,0,0,1 +210,1830,1800,10,0,0,1 +310,1830,1800,10,0,0,1 +410,1830,1800,10,0,0,1 +510,1830,1800,10,0,0,1 +610,1830,1800,10,0,0,1 +710,1830,1800,10,0,0,1 +810,1830,1800,10,0,0,1 +910,1830,1800,10,0,0,1 +1010,1830,1800,10,0,0,1 +1110,1830,1800,10,0,0,1 +1210,1830,1800,10,0,0,1 \ No newline at end of file diff --git a/tests/data/assets/chambre2.rad b/tests/data/assets/chambre2.rad new file mode 100644 index 0000000..5c1c7fb --- /dev/null +++ b/tests/data/assets/chambre2.rad @@ -0,0 +1,798 @@ +# chambre 2 + +scale_factor 100 + +void plastic ecran +0 +0 +5 +0 0 0 0 0 + +void metal MiroirCaissonLampes +0 +0 +5 +0.564 0.564 0.564 0.400 0 + + +void plastic MurBlanc +0 +0 +5 +0.772 0.772 0.772 0.200 0 + +void plastic Aquanappe +0 +0 +5 +0.043 0.043 0.043 0.300 0 + +void metal Sol +0 +0 +5 +0.370 0.370 0.370 0.100 0 + +void plastic target +0 +0 +5 +0.4 0.5 0.9 0.300 0 + +void plastic jaune +0 +0 +5 +1 1 0 0 0 + + +void light lamp32w +0 +0 +1 +0.32 0.32 0.32 + +Sol polygon sol_1 +0 +0 +12 +0 0 0 +0 388 0 +427 388 0 +427 0 0 + +Sol polygon sol_2 +0 +0 +12 +427 0 0 +427 280 0 +633 280 0 +633 0 0 + +Sol polygon sol_3 +0 +0 +12 +633 48 0 +633 280 0 +659 280 0 +659 48 0 + +MurBlanc polygon plafond_1 +0 +0 +12 +427 0 270 +427 388 270 +0 388 270 +0 0 270 + +MurBlanc polygon plafond_2 +0 +0 +12 +633 0 270 +633 280 270 +427 280 270 +427 0 270 + +MurBlanc polygon plafond_3 +0 +0 +12 +659 48 270 +659 280 270 +633 280 270 +633 48 270 + +MurBlanc polygon mur_1 +0 +0 +12 +0 0 0 +0 0 270 +0 388 270 +0 388 0 + +MurBlanc polygon mur_2 +0 +0 +12 +0 388 0 +0 388 270 +427 388 270 +427 388 0 + +MurBlanc polygon mur_3 +0 +0 +12 +427 388 0 +427 388 270 +427 280 270 +427 280 0 + +MurBlanc polygon mur_4 +0 +0 +12 +427 280 0 +427 280 270 +659 280 270 +659 280 0 + +MurBlanc polygon mur_5 +0 +0 +12 +659 280 0 +659 280 270 +659 48 270 +659 48 0 + +MurBlanc polygon mur_6 +0 +0 +12 +659 48 0 +659 48 270 +633 48 270 +633 48 0 + +MurBlanc polygon mur_7 +0 +0 +12 +633 48 0 +633 48 270 +633 0 270 +633 0 0 + +MurBlanc polygon mur_8 +0 +0 +12 +633 0 0 +633 0 270 +0 0 270 +0 0 0 + +Aquanappe polygon tablette_basse_gauche +0 +0 +12 +0 15 27 +0 55 27 +630 55 27 +630 15 27 + +MurBlanc polygon tablette_basse_gauche_rebord_haut +0 +0 +12 +0 15 27 +630 15 27 +630 15 33 +0 15 33 + +MurBlanc polygon tablette_basse_gauche_rebord_bas +0 +0 +12 +0 55 27 +0 55 17 +630 55 17 +630 55 27 + +Aquanappe polygon tablette_haute_gauche +0 +0 +12 +0 15 87 +0 55 87 +630 55 87 +630 15 87 + +MurBlanc polygon tablette_haute_gauche_rebord_haut +0 +0 +12 +0 15 87 +630 15 87 +630 15 93 +0 15 93 + +MurBlanc polygon tablette_haute_gauche_rebord_bas +0 +0 +12 +0 55 87 +0 55 77 +630 55 77 +630 55 87 + + +MiroirCaissonLampes polygon plateau_gauche_lampe_du_haut +0 +0 +12 +630 15 252 +630 55 252 +0 55 252 +0 15 252 + +MiroirCaissonLampes polygon plateau_gauche_lampe_du_haut_rebord +0 +0 +12 +630 55 252 +630 55 246 +0 55 246 +0 55 252 + +MurBlanc polygon tablette_gauche_lampe_du_haut_rebord +0 +0 +12 +0 55 252 +0 55 246 +630 55 246 +630 55 252 + +Aquanappe polygon tablette_basse_droite +0 +0 +12 +0 333 27 +0 373 27 +427 373 27 +427 333 27 + +MurBlanc polygon tablette_basse_droite_rebord_haut +0 +0 +12 +0 373 27 +0 373 33 +427 373 33 +427 373 27 + +MurBlanc polygon tablette_basse_droite_rebord_bas +0 +0 +12 +0 333 27 +427 333 27 +427 333 17 +0 333 17 + +Aquanappe polygon tablette_haute_droite +0 +0 +12 +0 373 87 +427 373 87 +427 333 87 +0 333 87 + +MurBlanc polygon tablette_haute_droite_rebord_haut +0 +0 +12 +0 373 87 +0 373 93 +427 373 93 +427 373 87 + +MurBlanc polygon tablette_haute_droite_rebord_bas +0 +0 +12 +0 333 87 +427 333 87 +427 333 77 +0 333 77 + +MiroirCaissonLampes polygon plateau_droite_lampe_du_haut +0 +0 +12 +427 333 252 +427 373 252 +0 373 252 +0 333 252 + +MiroirCaissonLampes polygon plateau_droite_lampe_du_haut_rebord +0 +0 +12 +0 333 246 +427 333 246 +427 333 252 +0 333 252 + +jaune polygon anchor +0 +0 +12 +305 15 88 +305 55 88 +320 55 88 +320 15 88 + +# lamp400w point_light ampoule4 +# 12 25 5 + +# lamp400w spot_light spot2 +# 12 5 2 +# 170 +# 1 0 1 + +lamp32w point_light neon1 +86 21 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon2 +86 25 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon3 +86 29 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon4 +86 33 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon5 +86 37 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon6 +86 41 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon7 +86 45 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon8 +86 49 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon9 +239 21 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon10 +239 25 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon11 +239 29 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon12 +239 33 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon13 +239 37 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon14 +239 41 85 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon15 +239 45 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon16 +239 49 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon17 +390 21 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon18 +390 25 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon19 +390 29 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon20 +390 33 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon21 +390 37 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon22 +390 41 85 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon23 +390 45 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon24 +390 49 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon25 +548 21 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon26 +548 25 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon27 +548 29 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon28 +548 33 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon29 +548 37 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon30 +548 41 85 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon31 +548 45 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon32 +548 49 85 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon33 +86 21 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon34 +86 25 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon35 +86 29 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon36 +86 33 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon37 +86 37 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon38 +86 41 250 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon39 +86 45 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon40 +86 49 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon41 +239 21 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon42 +239 25 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon43 +239 29 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon44 +239 33 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon45 +239 37 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon46 +239 41 250 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon47 +239 45 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon48 +239 49 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon49 +390 21 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon50 +390 25 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon51 +390 29 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon52 +390 33 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon53 +390 37 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon54 +390 41 250 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon55 +390 45 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon56 +390 49 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon57 +548 21 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon58 +548 25 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon59 +548 29 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon60 +548 33 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon61 +548 37 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon62 +548 41 250 # centre +#ß150 # longueur +#ß2.6 # diametre +#ß120 # angle +#ß0 0 1 # direction + +lamp32w point_light neon63 +548 45 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction + +lamp32w point_light neon64 +548 49 250 # centre +#150 # longueur +#2.6 # diametre +#120 # angle +#0 0 1 # direction diff --git a/tests/testChamber.rad b/tests/data/assets/testChamber.rad similarity index 100% rename from tests/testChamber.rad rename to tests/data/assets/testChamber.rad diff --git a/tests/data/assets/testChamber_original.rad b/tests/data/assets/testChamber_original.rad new file mode 100644 index 0000000..629819c --- /dev/null +++ b/tests/data/assets/testChamber_original.rad @@ -0,0 +1,1128 @@ +# -*- text -*- +# -*- coding: iso-8859-15 -*- +# radiance file for Sec2 +# generated by makeChamber.py on 20191025-2044 +# # # # # # # # # # # # # # # # # # # # # # # +# # +# lambdaNm 655-666 +# fauxPlafond oui +# dureeSimu 4.11249295691E-12 + + +scale_factor 1000 + +void plastic Aquanappe +0 +0 +5 +0.043 0.043 0.043 0.300 0 + +void metal CentrePlafond +0 +0 +5 +0.544 0.544 0.544 0.500 0 + +void metal CorniereAlu +0 +0 +5 +0.665 0.665 0.665 0.300 0 + +void metal PiedsTablette +0 +0 +5 +0.737 0.737 0.737 0.300 0 + +void metal MiroirCaissonLampes +0 +0 +5 +0.564 0.564 0.564 0.400 0 + +void metal Sol +0 +0 +5 +0.370 0.370 0.370 0.100 0 + +void plastic MurBlanc +0 +0 +5 +0.772 0.772 0.772 0.200 0 + +void metal SousBasstMiroirsVerticaux +0 +0 +5 +0.631 0.631 0.631 0.400 0 + +void metal MurMetal +0 +0 +5 +0.645 0.645 0.645 0.300 0 + +void metal MurMetalTrou +0 +0 +5 +0.613 0.613 0.613 0.300 0 + +void plastic pot +0 +0 +5 +0.062 0.062 0.062 0.300 0 + +void plastic substrat +0 +0 +5 +0.000 0.000 0.000 0.050 0 + +void plastic spectralon +0 +0 +5 +0.990 0.990 0.990 0.000 0 + +void trans Makrolon +0 +0 +7 +0.161 0.161 0.161 0.300 0.5 0.755473742005 0 + +void plastic peintureVerte +0 +0 +5 +0.160 0.160 0.160 0.000 0 + +void plastic ecran +0 +0 +5 +0 0 0 0 0 + +void plastic rouge +0 +0 +5 +1 0 0 0 0 + +void plastic jaune +0 +0 +5 +1 1 0 0 0 + +void light lumf +0 +0 +3 +0.28 0.28 0.28 + +void light lum1 +0 +0 +3 +0.2 0.2 0.2 + +void light lumN +0 +0 +3 +0.88 0.88 0.88 + +void light lumF +0 +0 +3 +1.0 1.0 1.0 + +void x lumM +0 +0 +3 +0.58 0.58 0.58 + +void light lum400 +0 +0 +3 +0.4 0.4 0.4 + +void light lumG +0 +0 +3 +0.0 0.0 0.0 + +void light lumV +0 +0 +3 +0.0 0.25 0.0 + +Sol polygon dallage +0 +0 +12 +0.0 0.0 0 +2400.0 0.0 0 +2400.0 1840.0 0 +0.0 1840.0 0 + +MurMetal polygon paroix0 +0 +0 +12 +0.0 0 0.0 +0.0 0 1970.0 +2400.0 0 1970.0 +2400.0 0 0.0 + +MurMetal polygon paroix1 +0 +0 +12 +2400.0 1840.0 0.0 +2400.0 1840.0 1970.0 +0.0 1840.0 1970.0 +0.0 1840.0 0.0 + +MurBlanc polygon paroiy0 +0 +0 +12 +0 0.0 0.0 +0 1840.0 0.0 +0 1840.0 1970.0 +0 0.0 1970.0 + +MurBlanc polygon paroiy1 +0 +0 +12 +2400.0 1840.0 0.0 +2400.0 0.0 0.0 +2400.0 0.0 1970.0 +2400.0 1840.0 1970.0 + +CorniereAlu polygon linteau +0 +0 +12 +2375.0 570.0 1880.0 +2425.0 570.0 1880.0 +2425.0 1270.0 1880.0 +2375.0 1270.0 1880.0 + +CorniereAlu polygon linteauR +0 +0 +12 +2375.0 1270.0 1880.0 +2425.0 1270.0 1880.0 +2425.0 570.0 1880.0 +2375.0 570.0 1880.0 + +CorniereAlu polygon montantG +0 +0 +12 +2375.0 1270.0 0.0 +2375.0 1270.0 1880.0 +2425.0 1270.0 1880.0 +2425.0 1270.0 0.0 + +CorniereAlu polygon montantGr +0 +0 +12 +2425.0 1270.0 0.0 +2425.0 1270.0 1880.0 +2375.0 1270.0 1880.0 +2375.0 1270.0 0.0 + +CorniereAlu polygon montantD +0 +0 +12 +2375.0 570.0 0.0 +2375.0 570.0 1880.0 +2425.0 570.0 1880.0 +2425.0 570.0 0.0 + +CorniereAlu polygon montantDr +0 +0 +12 +2425.0 570.0 0.0 +2425.0 570.0 1880.0 +2375.0 570.0 1880.0 +2375.0 570.0 0.0 + +MiroirCaissonLampes polygon ref10Narrow +0 +0 +12 +155.5 165.0 2155.0 +324.5 165.0 2155.0 +324.5 141.539619811 2177.2 +155.5 141.539619811 2177.2 +MiroirCaissonLampes polygon ref10NarrowR +0 +0 +12 +324.5 165.0 2155.0 +155.5 165.0 2155.0 +155.5 141.539619811 2177.2 +324.5 141.539619811 2177.2 +MiroirCaissonLampes polygon ref10Wide +0 +0 +12 +324.5 165.0 2155.0 +155.5 165.0 2155.0 +155.5 193.618176043 2180.0 +324.5 193.618176043 2180.0 +MiroirCaissonLampes polygon ref10WideR +0 +0 +12 +155.5 165.0 2155.0 +324.5 165.0 2155.0 +324.5 193.618176043 2180.0 +155.5 193.618176043 2180.0 + +MiroirCaissonLampes polygon ref11Narrow +0 +0 +12 +2065.5 180.0 2155.0 +2234.5 180.0 2155.0 +2234.5 156.539619811 2177.2 +2065.5 156.539619811 2177.2 +MiroirCaissonLampes polygon ref11NarrowR +0 +0 +12 +2234.5 180.0 2155.0 +2065.5 180.0 2155.0 +2065.5 156.539619811 2177.2 +2234.5 156.539619811 2177.2 +MiroirCaissonLampes polygon ref11Wide +0 +0 +12 +2234.5 180.0 2155.0 +2065.5 180.0 2155.0 +2065.5 208.618176043 2180.0 +2234.5 208.618176043 2180.0 +MiroirCaissonLampes polygon ref11WideR +0 +0 +12 +2065.5 180.0 2155.0 +2234.5 180.0 2155.0 +2234.5 208.618176043 2180.0 +2065.5 208.618176043 2180.0 + +MiroirCaissonLampes polygon ref12Narrow +0 +0 +12 +2247.5 1659.0 2155.0 +2078.5 1659.0 2155.0 +2078.5 1682.46038019 2177.2 +2247.5 1682.46038019 2177.2 +MiroirCaissonLampes polygon ref12NarrowR +0 +0 +12 +2078.5 1659.0 2155.0 +2247.5 1659.0 2155.0 +2247.5 1682.46038019 2177.2 +2078.5 1682.46038019 2177.2 +MiroirCaissonLampes polygon ref12Wide +0 +0 +12 +2078.5 1659.0 2155.0 +2247.5 1659.0 2155.0 +2247.5 1630.38182396 2180.0 +2078.5 1630.38182396 2180.0 +MiroirCaissonLampes polygon ref12WideR +0 +0 +12 +2247.5 1659.0 2155.0 +2078.5 1659.0 2155.0 +2078.5 1630.38182396 2180.0 +2247.5 1630.38182396 2180.0 + +MiroirCaissonLampes polygon ref13Narrow +0 +0 +12 +155.5 1666.0 2155.0 +324.5 1666.0 2155.0 +324.5 1642.53961981 2177.2 +155.5 1642.53961981 2177.2 +MiroirCaissonLampes polygon ref13NarrowR +0 +0 +12 +324.5 1666.0 2155.0 +155.5 1666.0 2155.0 +155.5 1642.53961981 2177.2 +324.5 1642.53961981 2177.2 +MiroirCaissonLampes polygon ref13Wide +0 +0 +12 +324.5 1666.0 2155.0 +155.5 1666.0 2155.0 +155.5 1694.61817604 2180.0 +324.5 1694.61817604 2180.0 +MiroirCaissonLampes polygon ref13WideR +0 +0 +12 +155.5 1666.0 2155.0 +324.5 1666.0 2155.0 +324.5 1694.61817604 2180.0 +155.5 1694.61817604 2180.0 + +MiroirCaissonLampes polygon ref20Narrow +0 +0 +12 +651.5 176.0 2150.41031206 +820.5 176.0 2150.41031206 +820.5 149.041046158 2168.19919191 +651.5 149.041046158 2168.19919191 +MiroirCaissonLampes polygon ref20NarrowR +0 +0 +12 +820.5 176.0 2150.41031206 +651.5 176.0 2150.41031206 +651.5 149.041046158 2168.19919191 +820.5 149.041046158 2168.19919191 +MiroirCaissonLampes polygon ref20Wide +0 +0 +12 +820.5 176.0 2150.41031206 +651.5 176.0 2150.41031206 +651.5 199.842197202 2180.0 +820.5 199.842197202 2180.0 +MiroirCaissonLampes polygon ref20WideR +0 +0 +12 +651.5 176.0 2150.41031206 +820.5 176.0 2150.41031206 +820.5 199.842197202 2180.0 +651.5 199.842197202 2180.0 + +MiroirCaissonLampes polygon ref21Narrow +0 +0 +12 +1580.5 169.5 2154.37185178 +1749.5 169.5 2154.37185178 +1749.5 145.553344987 2176.04642565 +1580.5 145.553344987 2176.04642565 +MiroirCaissonLampes polygon ref21NarrowR +0 +0 +12 +1749.5 169.5 2154.37185178 +1580.5 169.5 2154.37185178 +1580.5 145.553344987 2176.04642565 +1749.5 145.553344987 2176.04642565 +MiroirCaissonLampes polygon ref21Wide +0 +0 +12 +1749.5 169.5 2154.37185178 +1580.5 169.5 2154.37185178 +1580.5 197.557049364 2180.0 +1749.5 197.557049364 2180.0 +MiroirCaissonLampes polygon ref21WideR +0 +0 +12 +1580.5 169.5 2154.37185178 +1749.5 169.5 2154.37185178 +1749.5 197.557049364 2180.0 +1580.5 197.557049364 2180.0 + +MiroirCaissonLampes polygon ref22Narrow +0 +0 +12 +1758.5 1670.0 2155.0 +1589.5 1670.0 2155.0 +1589.5 1693.46038019 2177.2 +1758.5 1693.46038019 2177.2 +MiroirCaissonLampes polygon ref22NarrowR +0 +0 +12 +1589.5 1670.0 2155.0 +1758.5 1670.0 2155.0 +1758.5 1693.46038019 2177.2 +1589.5 1693.46038019 2177.2 +MiroirCaissonLampes polygon ref22Wide +0 +0 +12 +1589.5 1670.0 2155.0 +1758.5 1670.0 2155.0 +1758.5 1641.38182396 2180.0 +1589.5 1641.38182396 2180.0 +MiroirCaissonLampes polygon ref22WideR +0 +0 +12 +1758.5 1670.0 2155.0 +1589.5 1670.0 2155.0 +1589.5 1641.38182396 2180.0 +1758.5 1641.38182396 2180.0 + +MiroirCaissonLampes polygon ref23Narrow +0 +0 +12 +647.5 1672.0 2149.20305951 +816.5 1672.0 2149.20305951 +816.5 1644.14699443 2165.55663769 +647.5 1644.14699443 2165.55663769 +MiroirCaissonLampes polygon ref23NarrowR +0 +0 +12 +816.5 1672.0 2149.20305951 +647.5 1672.0 2149.20305951 +647.5 1644.14699443 2165.55663769 +816.5 1644.14699443 2165.55663769 +MiroirCaissonLampes polygon ref23Wide +0 +0 +12 +816.5 1672.0 2149.20305951 +647.5 1672.0 2149.20305951 +647.5 1694.26091769 2180.0 +816.5 1694.26091769 2180.0 +MiroirCaissonLampes polygon ref23WideR +0 +0 +12 +647.5 1672.0 2149.20305951 +816.5 1672.0 2149.20305951 +816.5 1694.26091769 2180.0 +647.5 1694.26091769 2180.0 + +MiroirCaissonLampes polygon ref40Narrow +0 +0 +12 +179.0 619.5 2155.0 +179.0 450.5 2155.0 +155.539619811 450.5 2177.2 +155.539619811 619.5 2177.2 +MiroirCaissonLampes polygon ref40NarrowR +0 +0 +12 +179.0 450.5 2155.0 +179.0 619.5 2155.0 +155.539619811 619.5 2177.2 +155.539619811 450.5 2177.2 +MiroirCaissonLampes polygon ref40Wide +0 +0 +12 +179.0 450.5 2155.0 +179.0 619.5 2155.0 +207.618176043 619.5 2180.0 +207.618176043 450.5 2180.0 +MiroirCaissonLampes polygon ref40WideR +0 +0 +12 +179.0 619.5 2155.0 +179.0 450.5 2155.0 +207.618176043 450.5 2180.0 +207.618176043 619.5 2180.0 + +MiroirCaissonLampes polygon ref41Narrow +0 +0 +12 +2211.5 452.5 2155.0 +2211.5 621.5 2155.0 +2234.96038019 621.5 2177.2 +2234.96038019 452.5 2177.2 +MiroirCaissonLampes polygon ref41NarrowR +0 +0 +12 +2211.5 621.5 2155.0 +2211.5 452.5 2155.0 +2234.96038019 452.5 2177.2 +2234.96038019 621.5 2177.2 +MiroirCaissonLampes polygon ref41Wide +0 +0 +12 +2211.5 621.5 2155.0 +2211.5 452.5 2155.0 +2182.88182396 452.5 2180.0 +2182.88182396 621.5 2180.0 +MiroirCaissonLampes polygon ref41WideR +0 +0 +12 +2211.5 452.5 2155.0 +2211.5 621.5 2155.0 +2182.88182396 621.5 2180.0 +2182.88182396 452.5 2180.0 + +MiroirCaissonLampes polygon ref42Narrow +0 +0 +12 +2228.5 1377.5 2155.0 +2228.5 1208.5 2155.0 +2205.03961981 1208.5 2177.2 +2205.03961981 1377.5 2177.2 +MiroirCaissonLampes polygon ref42NarrowR +0 +0 +12 +2228.5 1208.5 2155.0 +2228.5 1377.5 2155.0 +2205.03961981 1377.5 2177.2 +2205.03961981 1208.5 2177.2 +MiroirCaissonLampes polygon ref42Wide +0 +0 +12 +2228.5 1208.5 2155.0 +2228.5 1377.5 2155.0 +2257.11817604 1377.5 2180.0 +2257.11817604 1208.5 2180.0 +MiroirCaissonLampes polygon ref42WideR +0 +0 +12 +2228.5 1377.5 2155.0 +2228.5 1208.5 2155.0 +2257.11817604 1208.5 2180.0 +2257.11817604 1377.5 2180.0 + +MiroirCaissonLampes polygon ref43Narrow +0 +0 +12 +163.0 1381.5 2155.0 +163.0 1212.5 2155.0 +139.539619811 1212.5 2177.2 +139.539619811 1381.5 2177.2 +MiroirCaissonLampes polygon ref43NarrowR +0 +0 +12 +163.0 1212.5 2155.0 +163.0 1381.5 2155.0 +139.539619811 1381.5 2177.2 +139.539619811 1212.5 2177.2 +MiroirCaissonLampes polygon ref43Wide +0 +0 +12 +163.0 1212.5 2155.0 +163.0 1381.5 2155.0 +191.618176043 1381.5 2180.0 +191.618176043 1212.5 2180.0 +MiroirCaissonLampes polygon ref43WideR +0 +0 +12 +163.0 1381.5 2155.0 +163.0 1212.5 2155.0 +191.618176043 1212.5 2180.0 +191.618176043 1381.5 2180.0 + + +ecran polygon lamp20AV +0 +0 +27 +751.0 188.099996 2103.0 +751.0 185.269134698 2095.22227249 +751.0 178.101142255 2091.08383013 +751.0 169.950002 2092.52109608 +751.0 164.629723047 2098.86155763 +751.0 164.629723047 2107.13844237 +751.0 169.950002 2113.47890392 +751.0 178.101142255 2114.91616987 +751.0 185.269134698 2110.77772751 + +ecran polygon lamp20AR +0 +0 +27 +721.0 187.55 2103.0 +721.0 184.847813318 2110.42419689 +721.0 178.005636452 2114.37452955 +721.0 170.225 2113.00259341 +721.0 165.14655023 2106.95033266 +721.0 165.14655023 2099.04966734 +721.0 170.225 2092.99740659 +721.0 178.005636452 2091.62547045 +721.0 184.847813318 2095.57580311 + +lum400 cylinder lamp20Str +0 +0 +7 +719.62 176.0 2103.0 +747.193 176.0 2103.0 +0.1 + + +ecran polygon lamp21AV +0 +0 +27 +1650.0 167.900004 2103.0 +1650.0 170.730865302 2095.22227249 +1650.0 177.898857745 2091.08383013 +1650.0 186.049998 2092.52109608 +1650.0 191.370276953 2098.86155763 +1650.0 191.370276953 2107.13844237 +1650.0 186.049998 2113.47890392 +1650.0 177.898857745 2114.91616987 +1650.0 170.730865302 2110.77772751 + +ecran polygon lamp21AR +0 +0 +27 +1680.0 168.45 2103.0 +1680.0 171.152186682 2110.42419689 +1680.0 177.994363548 2114.37452955 +1680.0 185.775 2113.00259341 +1680.0 190.85344977 2106.95033266 +1680.0 190.85344977 2099.04966734 +1680.0 185.775 2092.99740659 +1680.0 177.994363548 2091.62547045 +1680.0 171.152186682 2095.57580311 + +lum400 cylinder lamp21Str +0 +0 +7 +1681.38 180.0 2103.0 +1653.807 180.0 2103.0 +0.1 + + +ecran polygon lamp22AV +0 +0 +27 +1659.0 1644.900004 2100.0 +1659.0 1647.7308653 2092.22227249 +1659.0 1654.89885774 2088.08383013 +1659.0 1663.049998 2089.52109608 +1659.0 1668.37027695 2095.86155763 +1659.0 1668.37027695 2104.13844237 +1659.0 1663.049998 2110.47890392 +1659.0 1654.89885774 2111.91616987 +1659.0 1647.7308653 2107.77772751 + +ecran polygon lamp22AR +0 +0 +27 +1689.0 1645.45 2100.0 +1689.0 1648.15218668 2107.42419689 +1689.0 1654.99436355 2111.37452955 +1689.0 1662.775 2110.00259341 +1689.0 1667.85344977 2103.95033266 +1689.0 1667.85344977 2096.04966734 +1689.0 1662.775 2089.99740659 +1689.0 1654.99436355 2088.62547045 +1689.0 1648.15218668 2092.57580311 + +lum400 cylinder lamp22Str +0 +0 +7 +1690.38 1657.0 2100.0 +1662.807 1657.0 2100.0 +0.1 + + +ecran polygon lamp23AV +0 +0 +27 +747.0 1682.099996 2105.0 +747.0 1679.2691347 2097.22227249 +747.0 1672.10114226 2093.08383013 +747.0 1663.950002 2094.52109608 +747.0 1658.62972305 2100.86155763 +747.0 1658.62972305 2109.13844237 +747.0 1663.950002 2115.47890392 +747.0 1672.10114226 2116.91616987 +747.0 1679.2691347 2112.77772751 + +ecran polygon lamp23AR +0 +0 +27 +717.0 1681.55 2105.0 +717.0 1678.84781332 2112.42419689 +717.0 1672.00563645 2116.37452955 +717.0 1664.225 2115.00259341 +717.0 1659.14655023 2108.95033266 +717.0 1659.14655023 2101.04966734 +717.0 1664.225 2094.99740659 +717.0 1672.00563645 2093.62547045 +717.0 1678.84781332 2097.57580311 + +lum400 cylinder lamp23Str +0 +0 +7 +715.62 1670.0 2105.0 +743.193 1670.0 2105.0 +0.1 + + + +Aquanappe polygon tableAMaree +0 +0 +12 +0.0 470.0 900 +2040.0 470.0 900 +2040.0 1370.0 900 +0.0 1370.0 900 + + +Aquanappe polygon soustableAMaree +0 +0 +12 +0.0 1370.0 899.5 +2040.0 1370.0 899.5 +2040.0 470.0 899.5 +0.0 470.0 899.5 + +Aquanappe polygon coteGtableAMaree +0 +0 +12 +0.0 1370.0 740.0 +0.0 1370.0 940.0 +2040.0 1370.0 940.0 +2040.0 1370.0 740.0 + +Aquanappe polygon coteGtableAMareer +0 +0 +12 +2040.0 1370.5 740.0 +2040.0 1370.5 940.0 +0.0 1370.5 940.0 +0.0 1370.5 740.0 + +Aquanappe polygon coteDtableAMaree +0 +0 +12 +0.0 470.0 740.0 +0.0 470.0 940.0 +2040.0 470.0 940.0 +2040.0 470.0 740.0 + +Aquanappe polygon coteDtableAMareer +0 +0 +12 +2040.0 469.5 740.0 +2040.0 469.5 940.0 +0.0 469.5 940.0 +0.0 469.5 740.0 + +Aquanappe polygon coteAVtableAMaree +0 +0 +12 +2040 470.0 740.0 +2040 1370.0 740.0 +2040 1370.0 940.0 +2040 470.0 940.0 + +Aquanappe polygon coteAVtableAMareer +0 +0 +12 +2040.5 1370.0 740.0 +2040.5 470.0 740.0 +2040.5 470.0 940.0 +2040.5 1370.0 940.0 + +Aquanappe polygon coteARtableAMaree +0 +0 +12 +1.0 470.0 740.0 +1.0 1370.0 740.0 +1.0 1370.0 940.0 +1.0 470.0 940.0 + +Aquanappe polygon coteARtableAMareer +0 +0 +12 +0.5 1370.0 740.0 +0.5 470.0 740.0 +0.5 470.0 940.0 +0.5 1370.0 940.0 + +CorniereAlu polygon cornicheG +0 +0 +12 +0.0 1800.0 1970 +2400.0 1800.0 1970 +2400.0 1840.0 1970 +0.0 1840.0 1970 + +CorniereAlu polygon cornicheGr +0 +0 +12 +0.0 1840.0 1970.0 +2400.0 1840.0 1970.0 +2400.0 1800.0 1970.0 +0.0 1800.0 1970.0 + +CorniereAlu polygon cornicheD +0 +0 +12 +0.0 0.0 1970 +2400.0 0.0 1970 +2400.0 40.0 1970 +0.0 40.0 1970 + +CorniereAlu polygon cornicheDr +0 +0 +12 +0.0 40.0 1970.0 +2400.0 40.0 1970.0 +2400.0 0.0 1970.0 +0.0 0.0 1970.0 + +CorniereAlu polygon cornicheAV +0 +0 +12 +2360.0 0.0 1970 +2400.0 0.0 1970 +2400.0 1840.0 1970 +2360.0 1840.0 1970 + +CorniereAlu polygon cornicheAVr +0 +0 +12 +2360.0 1840.0 1970.0 +2400.0 1840.0 1970.0 +2400.0 0.0 1970.0 +2360.0 0.0 1970.0 + +CorniereAlu polygon cornicheAR +0 +0 +12 +0.0 0.0 1970 +40.0 0.0 1970 +40.0 1840.0 1970 +0.0 1840.0 1970 + +CorniereAlu polygon cornicheARr +0 +0 +12 +0.0 1840.0 1970.0 +40.0 1840.0 1970.0 +40.0 0.0 1970.0 +0.0 0.0 1970.0 + +MurMetal polygon caissonx0 +0 +0 +12 +0.0 0 1970.0 +0.0 0 2180.0 +2400.0 0 2180.0 +2400.0 0 1970.0 + +MurMetal polygon caissonx1 +0 +0 +12 +2400.0 1840.0 1970.0 +2400.0 1840.0 2180.0 +0.0 1840.0 2180.0 +0.0 1840.0 1970.0 + +MurBlanc polygon caissony0 +0 +0 +12 +0 0.0 1970.0 +0 1840.0 1970.0 +0 1840.0 2180.0 +0 0.0 2180.0 + +MurBlanc polygon caissony1 +0 +0 +12 +2400.0 1840.0 1970.0 +2400.0 0.0 1970.0 +2400.0 0.0 2180.0 +2400.0 1840.0 2180.0 + +MiroirCaissonLampes polygon refcaissonX0n +0 +0 +12 +50.0 50 2035.0 +50.0 50 2180.0 +2350.0 50 2180.0 +2350.0 50 2035.0 + +MiroirCaissonLampes polygon refcaissonX0a +0 +0 +12 +2350.0 50.0 2035.0 +2350.0 50.0 2180.0 +50.0 50.0 2180.0 +50.0 50.0 2035.0 + +MiroirCaissonLampes polygon refcaissonXYn +0 +0 +12 +50.0 1790 2035.0 +50.0 1790 2180.0 +2350.0 1790 2180.0 +2350.0 1790 2035.0 + +MiroirCaissonLampes polygon refcaissonXYa +0 +0 +12 +2350.0 1790.0 2035.0 +2350.0 1790.0 2180.0 +50.0 1790.0 2180.0 +50.0 1790.0 2035.0 + +MiroirCaissonLampes polygon refcaissonY0n +0 +0 +12 +50 50.0 2035.0 +50 1790.0 2035.0 +50 1790.0 2180.0 +50 50.0 2180.0 + +MiroirCaissonLampes polygon refcaissonY0a +0 +0 +12 +50.0 1790.0 2035.0 +50.0 50.0 2035.0 +50.0 50.0 2180.0 +50.0 1790.0 2180.0 + +MiroirCaissonLampes polygon refcaissonY0n +0 +0 +12 +2350 50.0 2035.0 +2350 1790.0 2035.0 +2350 1790.0 2180.0 +2350 50.0 2180.0 + +MiroirCaissonLampes polygon refcaissonY0a +0 +0 +12 +2350.0 1790.0 2035.0 +2350.0 50.0 2035.0 +2350.0 50.0 2180.0 +2350.0 1790.0 2180.0 + +MiroirCaissonLampes polygon refPlafond +0 +0 +12 +25.0 1815.0 2179.9 +2375.0 1815.0 2179.9 +2375.0 25.0 2179.9 +25.0 25.0 2179.9 + +CentrePlafond polygon depoli +0 +0 +12 +770.0 1365.0 2179.8 +1630.0 1365.0 2179.8 +1630.0 475.0 2179.8 +770.0 475.0 2179.8 + +Makrolon polygon fauxPlafondInf +0 +0 +12 +0.0 0.0 1970 +2400.0 0.0 1970 +2400.0 1840.0 1970 +0.0 1840.0 1970 + +substrat polygon anchor +0 +0 +12 +1150.0 860.0 980.5 +1280.0 860.0 980.5 +1280.0 980.0 980.5 +1150.0 980.0 980.5 + +pot cone flowerPot +0 +0 +8 +1215.0 920.0 900 +1215.0 920.0 980 +7.8 10.5 # in cm \ No newline at end of file diff --git a/tests/data/chambre1_spectrum b/tests/data/chambre1_spectrum new file mode 100644 index 0000000..04170db --- /dev/null +++ b/tests/data/chambre1_spectrum @@ -0,0 +1,201 @@ +"wavelength(nm)" "measured PPFD (umol m-2 s-1 nm-1)" +401 0.0555 +403 0.086 +405 0.14 +407 0.114 +409 0.1575 +411 0.2065 +413 0.234 +415 0.201 +417 0.2765 +419 0.302 +421 0.36 +423 0.3375 +425 0.242 +427 0.208 +429 0.1885 +431 0.199 +433 0.159 +435 0.2155 +437 0.2345 +439 0.1925 +441 0.1885 +443 0.1565 +445 0.1885 +447 0.179 +449 0.184 +451 0.171 +453 0.209 +455 0.21 +457 0.258 +459 0.25 +461 0.27 +463 0.252 +465 0.2465 +467 0.2135 +469 0.2425 +471 0.2105 +473 0.26 +475 0.2315 +477 0.2185 +479 0.254 +481 0.2235 +483 0.2305 +485 0.2075 +487 0.186 +489 0.2425 +491 0.2175 +493 0.228 +495 0.2405 +497 0.2205 +499 0.235 +501 0.2355 +503 0.255 +505 0.3305 +507 0.3 +509 0.271 +511 0.213 +513 0.2945 +515 0.2525 +517 0.257 +519 0.304 +521 0.2355 +523 0.274 +525 0.247 +527 0.244 +529 0.2585 +531 0.337 +533 0.3185 +535 0.629 +537 1.429 +539 0.9295 +541 0.602 +543 0.368 +545 0.292 +547 0.4865 +549 0.3045 +551 0.2805 +553 0.2555 +555 0.285 +557 0.307 +559 0.277 +561 0.266 +563 0.3195 +565 0.4485 +567 0.3795 +569 0.465 +571 0.3805 +573 0.3495 +575 0.3465 +577 0.4215 +579 0.38 +581 0.3535 +583 0.328 +585 0.3415 +587 0.4225 +589 0.388 +591 0.4325 +593 0.4095 +595 0.4485 +597 0.4735 +599 0.692 +601 0.5065 +603 0.459 +605 0.3925 +607 0.404 +609 0.4955 +611 0.4905 +613 0.4515 +615 0.465 +617 0.502 +619 0.46 +621 0.414 +623 0.4355 +625 0.3975 +627 0.574 +629 0.3875 +631 0.424 +633 0.399 +635 0.392 +637 0.4045 +639 0.4175 +641 0.377 +643 0.431 +645 0.4015 +647 0.4515 +649 0.399 +651 0.333 +653 0.3255 +655 0.405 +657 0.4895 +659 0.4705 +661 0.5295 +663 0.489 +665 0.425 +667 0.4685 +669 0.462 +671 0.415 +673 0.496 +675 0.4345 +677 0.3995 +679 0.49 +681 0.3655 +683 0.4245 +685 0.6275 +687 0.5065 +689 0.3495 +691 0.365 +693 0.322 +695 0.4385 +697 0.5325 +699 0.565 +701 0.3725 +703 0.309 +705 0.2635 +707 0.2415 +709 0.2245 +711 0.22 +713 0.2375 +715 0.211 +717 0.2025 +719 0.203 +721 0.2405 +723 0.284 +725 0.281 +727 0.2605 +729 0.284 +731 0.233 +733 0.1825 +735 0.185 +737 0.209 +739 0.2195 +741 0.2325 +743 0.2155 +745 0.1805 +747 0.1865 +749 0.266 +751 0.2185 +753 0.186 +755 0.468 +757 0.495 +759 0.268 +761 0.3175 +763 0.322 +765 0.336 +767 0.4145 +769 0.2955 +771 0.3175 +773 0.318 +775 0.23 +777 0.1885 +779 0.189 +781 0.2605 +783 0.297 +785 0.1735 +787 0.1455 +789 0.137 +791 0.1675 +793 0.2785 +795 0.312 +797 0.198 +799 0.1555 diff --git a/tests/cornellbox-water2.mtl b/tests/data/cornellbox-water2.mtl similarity index 100% rename from tests/cornellbox-water2.mtl rename to tests/data/cornellbox-water2.mtl diff --git a/tests/cornellbox-water2.obj b/tests/data/cornellbox-water2.obj similarity index 100% rename from tests/cornellbox-water2.obj rename to tests/data/cornellbox-water2.obj diff --git a/tests/data/points_calibration.csv b/tests/data/points_calibration.csv new file mode 100644 index 0000000..a6cd639 --- /dev/null +++ b/tests/data/points_calibration.csv @@ -0,0 +1,13 @@ +xSite,ySite,zSite,Nmes_655_665,Nmes_600_655 +110,930,1000,2.41383,12.0417 +1210,930,1000,3.57724,17.9562 +610,1130,1000,3.25052,16.2297 +110,1330,1000,2.26792,11.2207 +1210,1330,1000,3.52016,17.5338 +110,930,1400,2.25193,11.2783 +1210,930,1400,3.6964,18.4054 +610,1130,1400,3.50119,17.5885 +110,1330,1400,2.18031,10.8791 +610,1330,1400,3.91336,19.6182 +710,1330,1400,4.17343,20.8869 +1210,1330,1400,3.80179,18.8231 diff --git a/tests/data/rose-simple4.lpy b/tests/data/rose-simple4.lpy new file mode 100644 index 0000000..cbd11b5 --- /dev/null +++ b/tests/data/rose-simple4.lpy @@ -0,0 +1,292 @@ +import numpy as np + +PLOT = False + +import openalea.plantgl.all as pgl +from random import uniform + +# MODE +eHH, eLH, eLL = 0,1,2 +extern(mode = eHH) + +# CONSTANTS +LInMaxHH = [1.059800539, 1.189966785, 1.827049608, 2.71034115, 3.579133552, 4.172718956, 4.230389503, 3.491437335, 1.695154593] +LInMaxLH = [1.059800539, 1.204508653, 1.953969835, 2.863343811, 3.642338928, 3.965681209, 3.436935508, 1.781689133] +LInMaxAll = [ LInMaxHH, LInMaxLH] +LInMax = LInMaxAll[mode] + +LLeafMaxHH = [4.95119191, 5.80244474, 6.04279604, 6.89550067, 7.53690877, 8.91246671, 8.78497647, 9.60687317, 7.03919197] +LLeafMaxLH = [4.95119191, 5.85336564, 6.04279604, 6.7968139, 7.22423025, 8.15082507, 7.32201893, 6.02229011] +LLeafMaxAll = [ LLeafMaxHH, LLeafMaxLH] +LLeafMax = LLeafMaxAll[mode] + +tipInHH = [-6.785893478, -5.155096728, -3.524299978, -1.893503228, -0.262706478, 1.368090272, 2.998887022, 4.629683772, 6.260480522] +tipInLH = [-12.15862748, -9.494895078, -6.722438907, -4.004344621, -1.286250335, 1.43184395, 4.204300122, 6.868032522] +tipInAll = [tipInHH,tipInLH] +tipIn = tipInAll[mode] + +tipLeafHH = [-7.08901225, -5.18481189, -3.34220241, -1.56118379, 0.15824395, 1.81608083, 3.41232683, 4.94698197, 6.42004623] +tipLeafLH = [-12.3744804, -9.26527588, -6.32716968, -3.56016178, -0.96425218, 1.46055912, 3.71427211, 5.79688681] +tipLeafAll = [tipLeafHH,tipLeafLH] +tipLeaf = tipLeafAll[mode] + + +wIn = 0.19 +wLeaf = 0.14610141 + +internodeRadius = 0.2 +internodeLength = 2 +petioleRadius = 0.05 +petioleLength = 1.2 + +nbLeafLet = [5,5,7,7,7,5,5,3,3] + +flowerRadius = 2.5 +maxpetalLength = 3 +_petalWidth = 2.5 + +dt = 0.1 + + +def A(t): + return 0.8 + +# GRAPHICAL PARAMETERS + +PETAL_TAILLE = pgl.NurbsCurve2D( + ctrlPointList = pgl.Point3Array([(0, 0.501073, 1),(0.008267, 0.958827, 1),(0.308307, 0.987036, 1),(0.468023, 0.998576, 1),(1, 0.996814, 1)]) , + stride = 100) +PETAL_TAILLE = pgl.QuantisedFunction(PETAL_TAILLE) + +def sepalLength(t): return 1+2*(t/15) + +def sepalWidth(t): return 1+1*(t/15) + +def petalLength(t): return 0.02+3*(t/15) + +def petalWidth(t): return 0.02+2*(t/15) + + +from math import * +MAXSEPALANGLE = 3*pi/4 + +sepal_s = pgl.Polyline2D([(-0.5,-0.1),(0,0.1),(0.5,-0.1)]) +sepal_m = pgl.BezierCurve2D([(0,0,1),(0.1,1,1),(0.2,1,1),(0.4,0.3,1),(1,0,1)]) +sepal_r = pgl.QuantisedFunction(sepal_m) + + +petal_s = pgl.Polyline2D([(0.5,-0.1),(0,0.1),(-0.5,-0.1)]) +petal_p = pgl.BezierCurve2D([(0,0,1),(0.0,0.5,1),(1,0.5,1),(1,1,1)]) +petal_m = pgl.BezierCurve2D([(0,0,1),(0.1,1,1),(0.8,1,1),(1,0,1)]) +petal_r = pgl.QuantisedFunction(petal_m) + + + +import numpy as np +s = [(-0.5,0.1,1),(-0.01,0.1,1),(0,-0.1,1),(0.01,0.1,1),(0.5,0.1,1)] +p = [(0,0,1),(0.5,0.1,1),(1,-0.1,1)] +m = [(0,0,1),(0.1,1,1),(0.9,1,1),(1,0,1)] +leaf_s = pgl.NurbsCurve2D(s, stride=5) +leaf_p = pgl.BezierCurve2D(p) +leaf_m = pgl.BezierCurve2D(m) +def decal(p, u, v): + if divmod(u*100,v*100)[1] < 0.01: + return p*1.1 + else: return p +leaf_r = pgl.QuantisedFunction(pgl.Polyline2D([decal(leaf_m.getPointAt(u), u, 0.1) for u in np.arange(0,1.01,0.02)])) + + + +# FUNCTIONS + +def length_in(t, i): + return LInMax[i]/(1+exp(4*wIn*(tipIn[i]-t))) + + +def length_lf(t, i): + return LLeafMax[i]/(1+exp(4*wLeaf*(tipLeaf[i]-t))) + +# MODULES + +module Internode(t,i,l,c_m,c_s,ck,d) +module Leaf(l), LeafLet(t,i,l) +module Flower(t) +module Sepal(t), Petal(t) +module Bud(integrator,bursted) + +# RULES + +extern(V = 1.5) +extern(k = 0.5) +extern(delta = 0.5) +extern(gamma1 = 1.5) +extern(gamma2 = 0.2) +extern(alpha = 0.1) +extern(k1 = 1) +extern(k2 = 1) +extern(BURST_THRESHOLD = 1.) +extern(t = 0) + +MAXCM = 0 +MINCM = 1e5 +CONVSTEP = 100 + +plot1, plot2 = None, None +figure = None +ax = None + +def mfluxes(c_m): + return np.array([(c_m[i-(1 if i > 0 else 0)]+c_m[i+(1 if i < len(c_m)-1 else 0)])-2*c_mv for i,c_mv in enumerate(c_m)]) + +def EndEach(lstring): + global MAXCM, MINCM + internodes = [i for i,m in enumerate(lstring) if m.name == 'Internode'] + + t = np.array([lstring[i].t for i in internodes]) + c_m = np.array([lstring[i].c_m for i in internodes]) + c_s = np.array([lstring[i].c_s for i in internodes]) + ck = np.array([lstring[i].ck for i in internodes]) + d = np.array([lstring[i].d for i in internodes]) + + #print('S',c_m) + #print('S',mfluxes(c_m)) + + for i in range(CONVSTEP): + fluxes = mfluxes(c_m) + + c_s_s = (c_m*V)/(k+c_m) + c_s_d = delta*c_s + c_s += c_s_s-c_s_d + + d_c_m = - c_s_d - d*gamma1 - ck*gamma2 + fluxes*alpha + A(t) + c_m += d_c_m + + #print('E',c_m) + #print('E',mfluxes(c_m)) + MINCM = min(c_m) + MAXCM = max(c_m) + + for i,v in zip(internodes,c_m): + lstring[i].c_m = v + + for i,v in zip(internodes,c_s): + lstring[i].c_s = v + + #print([lstring[i].c_m for i,v in zip(internodes,c_m)]) + if PLOT: + global plot1, plot2, figure, ax + import matplotlib.pyplot as plt + if isAnimationEnabled() or isFrameDisplayed(): + values = [mod.integrator for mod in lstring if mod.name == 'Bud'] + values2 = c_s + if plot1 is None: + figure, ax = plt.subplots(figsize=(4,5)) + plot1, = ax.plot(list(range(len(values))),values, label='Integrator') + plot2, = ax.plot(list(range(len(values2))),values2, label='C_s') + ax.set_ylim(0,2) + ax.legend() + plt.show() + else: + plot1.set_ydata(values) + plot2.set_ydata(values2) + figure.canvas.draw() + figure.canvas.flush_events() + + +Axiom: + nproduce ,(2) Down(5) + for i in range(len(LLeafMax)): + nproduce Internode(0,i,length_in(0, i),0.5,0.2,0.5,length_in(dt, i)-length_in(0, i)) + nproduce /(137+uniform(-20,20)) Down(5) [Down(30) Bud(1, False) ] [ Down(60),(2) Leaf(0,i,length_lf(0, i))] + nproduce Internode(0,i,length_in(0, i),0.5,0.2,0.5,length_in(dt, i)-length_in(0, i)) + nproduce Flower(0) + +derivation length: 150 +ignore: / Down +production: + +Internode(t,i,l,c_m,c_s,ck, demand): + t += dt + l_t = length_in(t, int(i)) + d = l_t - l + l = l_t + produce Internode(t,i,l,c_m,c_s,ck, demand) + + +Leaf(t,i,l): + t += dt + l_t = length_lf(t, i) + nproduce Leaf(t,i,l_t) + +Flower(t) --> Flower(t+dt) + +Internode(t,i,l,c_m,c_s,ck, demand) < Bud(integ, bursted): + integ = 1/(k1*ck + k2*c_m) + if integ < BURST_THRESHOLD: + bursted = True + produce Bud(integ, bursted) + +interpretation: +maximum depth: 2 +group 0: + +Internode(t,i,l,c_m,c_s,ck, demand): + #print(c_m,d) + v = (c_m-MINCM)/(MAXCM-MINCM) + v = min(1,max(0,v)) + nproduce _(internodeRadius) InterpolateColors(5,3, v) F(l) + pass + +LeafLet(l): + nproduce ,(2) Elasticity(0.002) @Gc Sweep(leaf_p,leaf_s,l,l/15.,l*0.8, leaf_r) + + +Leaf(t,i,l): + nbst = (nbLeafLet[i]-1)//2 + nl = min(l/4, l / (nbst+1)) + nproduce SetWidth(petioleRadius) @Tp(0,0,-1) Elasticity(0.005) + for i in range(1,nbst+1): + a = 90-15*i + nproduce nF(nl,0.1) [ Left(a) LeafLet(l/2) ][ Right(a) LeafLet(l/2) ] + nproduce nF(nl,0.1) LeafLet(l/2.) + +Flower(t): + nproduce ,(2) + for i in range(4): + nproduce RollR(137) f(0.001) Sepal(t) + nproduce ,(3) + for i in range(10): + nproduce RollR(137) f(0.001) Petal(t) + +Petal(t): + ut = t/15 + l = petalLength(t) + nproduce [ @Gc Up(-20+30*ut) Sweep(petal_p,petal_s,l,l/10.,petalWidth(t), petal_r) ] + +Sepal(t): + ut = max(0.8,t/15) + l = sepalLength(t) + sepal_p = pgl.BezierCurve2D([(0,0,1),(0.0,0.5,1),(cos(MAXSEPALANGLE*ut),sin(MAXSEPALANGLE*ut),1)]) + nproduce [ @Gc Up(-20+30*ut) Sweep(sepal_p,sepal_s,l,l/10.,sepalWidth(t), sepal_r) ] + +Bud(integ, bursted): + budratio = 0.9 + budburstratio = 1.5 + budwidth = internodeRadius*budratio + #print(integ) + + if bursted : + budwidth *= budburstratio + nproduce ,(3) + else: + nproduce ,(2) + nproduce SetWidth(budwidth) SectionResolution(4) F(internodeRadius) Sphere() + +endlsystem +###### INITIALISATION ###### + +__lpy_code_version__ = 1.1 + +def __initialiseContext__(context): + context.animation_timestep = 0.108 + context.options.setSelection('Optimization',0) diff --git a/tests/data/simulation.ini b/tests/data/simulation.ini new file mode 100644 index 0000000..d88d2a9 --- /dev/null +++ b/tests/data/simulation.ini @@ -0,0 +1,13 @@ +#photon mapping config +$NB_PHOTONS 1000000 +$MAXIMUM_DEPTH 50 +$SCALE_FACTOR 1 +$T_MIN 0.1 +$KEEP_ALL 1 +$NB_THREAD 8 +$BACKFACE_CULLING yes +$RENDERING 0 +$BASE_SPECTRAL_RANGE 400 800 +$DIVIDED_SPECTRAL_RANGE 1 600 655 +$OPTICAL_PROPERTIES_DIR ./PO +$ENVIRONMENT_FILE ./assets/testChamber.rad diff --git a/tests/data/simulation_2.ini b/tests/data/simulation_2.ini new file mode 100644 index 0000000..deff73e --- /dev/null +++ b/tests/data/simulation_2.ini @@ -0,0 +1,13 @@ +#photon mapping config +$NB_PHOTONS 100 +$MAXIMUM_DEPTH 50 +$SCALE_FACTOR 1 +$T_MIN 0.1 +$NB_THREAD 8 +$KEEP_ALL 0 +$BACKFACE_CULLING yes +$RENDERING 1 +$BASE_SPECTRAL_RANGE 400 800 +$DIVIDED_SPECTRAL_RANGE 1 600 655 +$OPTICAL_PROPERTIES_DIR ./PO +$ENVIRONMENT_FILE ./assets/testChamber.rad diff --git a/tests/testChamberPH.mtl b/tests/data/testChamberPH.mtl similarity index 100% rename from tests/testChamberPH.mtl rename to tests/data/testChamberPH.mtl diff --git a/tests/testChamberPH.obj b/tests/data/testChamberPH.obj similarity index 100% rename from tests/testChamberPH.obj rename to tests/data/testChamberPH.obj diff --git a/tests/test_convert.py b/tests/test_convert.py index b625daa..59d31ef 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -1,12 +1,25 @@ -from openalea.plantgl.all import Sphere, Scene, Shape +from openalea.plantgl.all import Sphere, Scene, Shape, Text +from openalea.plantgl.scenegraph import Material -from openalea.spice.common.convert import pgl_to_spice +from openalea.spice.common.convert import pgl_to_spice, spice_add_pgl from openalea.spice.simulator import Simulator def test_plantgl_to_spice(): sim = Simulator() assert sim.scene.nVertices() == 0 - pgl_sc = Scene([Shape(Sphere(5))]) + pgl_sc = Scene([Shape(Sphere(5), Material(transparency=0.6)), Text("test")]) pgl_to_spice(pgl_sc, sim) assert sim.scene.nVertices() > 0 + + # With Adding sensors + pgl_sc = Scene([Shape(Sphere(5), Material(transparency=0.6)), Text("test")]) + pgl_to_spice(pgl_sc, sim, sensors=True, setup=True) + assert sim.scene.nVertices() > 0 + + # Test adding PGL scene directly + spice_add_pgl(sim, pgl_sc) + assert sim.scene.nVertices() > 0 + + spice_add_pgl(sim, pgl_sc, sensors=True, setup=True) + assert sim.scene.nVertices() > 0 \ No newline at end of file diff --git a/tests/test_energy.py b/tests/test_energy.py new file mode 100644 index 0000000..6b7f4e7 --- /dev/null +++ b/tests/test_energy.py @@ -0,0 +1,23 @@ +import pathlib + +from openalea.spice.energy.correct_energy import read_spectrum_file, \ + get_integral_of_band, get_correct_energy_coeff, get_points_calibration + +filepath = pathlib.Path(__file__).parent.resolve() / 'data' + +def test_energy_correction(): + spec, step, start = read_spectrum_file(str(filepath / 'chambre1_spectrum')) + integral = get_integral_of_band(range(start,800),range(660, 665), spec) + + assert 0 < integral < 1 + + integrals = get_correct_energy_coeff(range(start,800),[{"start": 660, "end": 665}], + str(filepath / 'chambre1_spectrum')) + for inte in integrals: + assert 0 < inte + +def test_calibration(): + points = get_points_calibration(list_sensors=[], + points_calibration_file=str(filepath / 'points_calibration.csv'), + divided_spectral_range=[{"start": 655, "end": 665},{"start": 600, "end": 655}]) + assert points is not None diff --git a/tests/test_load_environment.py b/tests/test_load_environment.py new file mode 100644 index 0000000..0e1fa4d --- /dev/null +++ b/tests/test_load_environment.py @@ -0,0 +1,20 @@ +from openalea.plantgl.scenegraph import QuadSet, Shape + +from openalea.plantgl.all import Scene as pglScene +from openalea.spice import Scene +from openalea.spice.loader.load_environment import addEnvironment, addLightDirectionPgl + +def test_addEnvironment(): + sc = Scene() + # A list of the coordinates of the square + points = [(-1, -1, 0), (1, -1, 0), (1, 1, 0), (-1, 1, 0)] + # A list of directions for the normals + normals = [(0, 0, 1) for i in range(4)] + # A list of indices that set the indices for the quads + indices = [(0, 1, 2, 3)] + # Creation of the quadset + sh = Shape(QuadSet(points, indices, normals, indices)) + + addEnvironment(sc, sh, 400, {},{},{}) + + addLightDirectionPgl(pglScene([sh]), 1) diff --git a/tests/test_load_plant.py b/tests/test_load_plant.py new file mode 100644 index 0000000..b3eaf61 --- /dev/null +++ b/tests/test_load_plant.py @@ -0,0 +1,15 @@ +import pathlib + +from openalea.spice import Scene, Vec3 + +from openalea.spice.loader.load_plant import add_lpy_file_to_scene + +filepath = pathlib.Path(__file__).parent.resolve() / 'data' + +def test_add_lpy_file_to_scene(): + sc = Scene() + tr = {} + list_sh_id = add_lpy_file_to_scene(sc, str(filepath / 'rose-simple4.lpy'), + 120, tr, Vec3(0,0,0)) + + assert list_sh_id is not None \ No newline at end of file diff --git a/tests/test_math.py b/tests/test_math.py index ee16b58..92c1ecd 100644 --- a/tests/test_math.py +++ b/tests/test_math.py @@ -1,4 +1,13 @@ -from openalea.spice.common.math import denormalize, average_vector +import numpy + +from openalea.spice.common.math import ( + denormalize, + average_vector, + cross_vector, + spherical_to_cartesian, + orthonormal_basis, + geo_hemisphere, +) from openalea.plantgl.all import Vector3 @@ -18,3 +27,39 @@ def test_average_vector(): average = average_vector(list_vector) assert average[0] == 0.5 and average[1] == 0.5 and average[2] == 0.5 + +def test_spherical_to_cartesian(): + cartesian = spherical_to_cartesian(theta=numpy.pi / 4, phi=numpy.pi / 4, + x_seg=10, y_seg=5) + numpy.testing.assert_almost_equal(cartesian[0], 0.2151032) + numpy.testing.assert_almost_equal(cartesian[1], 0.9697137) + numpy.testing.assert_almost_equal(cartesian[2], 0.1156969) + +def test_cross_vector(): + a, b = Vector3(0, 0, 0), Vector3(1, 1, 1) + + res = cross_vector(a, b) + + assert res[0] == 0 and res[1] == 0 and res[2] == 0 + +def test_orthonormal_basis(): + n = Vector3(0, 0, 0) + + t, b = orthonormal_basis(n) + + assert t[0] == 0 and t[1] == 0 and t[2] == 0 + assert b[0] == 0 and b[1] == 0 and b[2] == 0 + + n = Vector3(0, 1, 0) + + t, b = orthonormal_basis(n) + + assert t[0] == -1 and t[1] == 0 and t[2] == 0 + assert b[0] == 0 and b[1] == 0 and b[2] == -1 + +def test_geo_hemisphere(): + sphere = geo_hemisphere(centre=Vector3(0, 0, 0), + normal=Vector3(0, 0, 1), + rayon=5) + + assert sphere is not None \ No newline at end of file diff --git a/tests/test_photonmap.py b/tests/test_photonmap.py index d2722d5..3ad1dc9 100644 --- a/tests/test_photonmap.py +++ b/tests/test_photonmap.py @@ -1,10 +1,14 @@ +import pathlib + from openalea.spice import PhotonMapping, Scene, UniformSampler, Vec3 +filepath = pathlib.Path(__file__).parent.resolve() / 'data' + def test_photonmaps(): """Test if every photon maps has at least an element""" scene = Scene() - scene.loadModel("./tests/testChamberPH.obj") + scene.loadModel(str(filepath / "testChamberPH.obj")) pos = Vec3(0, 1, 0) scene.addPointLight(pos, 400, Vec3(1, 1, 1)) scene.build(False) diff --git a/tests/test_properties.py b/tests/test_properties.py index 76f8c2e..6151418 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -1,7 +1,7 @@ import pathlib from openalea.spice.reader.read_properties import setup_dataset_materials -filepath = pathlib.Path(__file__).parent.resolve() +filepath = pathlib.Path(__file__).parent.resolve() / 'data' def test_setup_materials(): diff --git a/tests/test_read_rad_geo.py b/tests/test_read_rad_geo.py index 5e64971..b6103fc 100644 --- a/tests/test_read_rad_geo.py +++ b/tests/test_read_rad_geo.py @@ -1,9 +1,15 @@ import pathlib from openalea.spice.reader.read_rad_geo import read_rad -filepath = pathlib.Path(__file__).parent.resolve() +filepath = pathlib.Path(__file__).parent.resolve() / 'data' def test_read_rad(): - sc = read_rad(filepath / "testChamber.rad", scale_factor=1, invert_normals=False) + sc = read_rad(filepath / "assets/testChamber.rad", scale_factor=1, invert_normals=False) assert sc is not None + + sc = read_rad(filepath / "assets/testChamber_original.rad", scale_factor=1, invert_normals=False) + assert sc is not None + + sc = read_rad(filepath / "assets/chambre2.rad", scale_factor=1, invert_normals=False) + assert sc is not None \ No newline at end of file diff --git a/tests/test_reflection.py b/tests/test_reflection.py index 3e558e0..8c1e792 100644 --- a/tests/test_reflection.py +++ b/tests/test_reflection.py @@ -1,11 +1,15 @@ +import pathlib + from openalea.spice import PhotonMapping, Scene, UniformSampler, Vec3 +filepath = pathlib.Path(__file__).parent.resolve() / 'data' + def test_reflection(): """Test if photon from a light source all end up on an absorbing surface.""" scene = Scene() - scene.loadModel("./tests/testChamberPH.obj") + scene.loadModel(str(filepath / "testChamberPH.obj")) pos = Vec3(0, 1, 0) scene.addPointLight(pos, 400, Vec3(1, 1, 1)) scene.build() diff --git a/tests/test_render.py b/tests/test_render.py index ae58937..67f3481 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -1,4 +1,5 @@ import os +import pathlib import random import sys @@ -11,11 +12,13 @@ UniformSampler, Vec3, ) +from openalea.spice.simulator import Simulator +filepath = pathlib.Path(__file__).parent.resolve() / 'data' def test_intersection(): scene = Scene() - scene.loadModel("./tests/cornellbox-water2.obj") + scene.loadModel(str(filepath / "cornellbox-water2.obj")) scene.build(True) n_samples = 2 @@ -69,3 +72,10 @@ def test_intersection(): intersection_worked = True assert intersection_worked os.remove("output.ppm") + +def test_render(): + simulator = Simulator(config_file=filepath / "simulation.ini") + simulator.configuration.KEEP_ALL = True + simulator.configuration.RENDERING = True + simulator.setupRender() + simulator.run() diff --git a/tests/test_scene.py b/tests/test_scene.py index 290f9d2..05ca73b 100644 --- a/tests/test_scene.py +++ b/tests/test_scene.py @@ -1,8 +1,11 @@ +import pathlib + from openalea.spice import Scene +filepath = pathlib.Path(__file__).parent.resolve() / 'data' def test_load_scene_with_lights(): scene = Scene() - scene.loadModel("./tests/cornellbox-water2.obj") + scene.loadModel(str(filepath / "cornellbox-water2.obj")) scene.build() assert scene.nLights() == 2 diff --git a/tests/test_simple_simulation.py b/tests/test_simple_simulation.py index 3ee03da..bfe7d0a 100644 --- a/tests/test_simple_simulation.py +++ b/tests/test_simple_simulation.py @@ -1,14 +1,36 @@ +import pathlib + +import pytest from openalea.plantgl.all import Color3, Material, Shape, TriangleSet +from openalea.spice import Vec3 +from openalea.spice.configuration import Configuration from openalea.spice.simulator import Simulator +filepath = pathlib.Path(__file__).parent.resolve() / 'data' + +def test_configuration(): + simulator = Simulator(config_file=filepath / "simulation.ini") + assert type(simulator.configuration) == Configuration + + simulator.configuration.read_file(filepath / "simulation_2.ini") + assert type(simulator.configuration) == Configuration + assert simulator.configuration.KEEP_ALL == 0 + + try: + conf = Configuration() + conf.read_file(filepath / "does not exist.txt") + except FileNotFoundError: + pass def test_simple_simulation(): - simulator = Simulator() + simulator = Simulator(config_file=filepath / "simulation.ini") # setup configuration simulator.configuration.nb_photons = 1000000 simulator.configuration.max_depth = 5 + simulator.configuration.DIVIDED_SPECTRAL_RANGE = [{"start": 655, "end": 665}, + {"start": 600, "end": 655}] simulator.resetScene() # setup environment @@ -51,6 +73,23 @@ def test_simple_simulation(): simulator.addVirtualSensorToScene( shape=sensor_sh, position=(0, 0, 3), scale_factor=1 ) + simulator.addFaceSensorsFromLpyFile(str(filepath / 'rose-simple4.lpy')) + + simulator.addPointLight(Vec3(0,5,0), 1000) # run + simulator.setup() simulator.run() + simulator.calibrateResults(str(filepath / "chambre1_spectrum"), + str(filepath / "point_calibration.csv")) + + simulator.results.writeResults() + +@pytest.mark.skip(reason="Segfault with pytest") +def test_visualization(): + simulator = Simulator(config_file=filepath / "simulation.ini") + simulator.run() + + simulator.visualizeScene() + simulator.visualizePhotons() + simulator.visualizeRays() \ No newline at end of file diff --git a/tests/test_tools.py b/tests/test_tools.py index d6a6f13..e0735e0 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -16,6 +16,9 @@ def test_wavelength2rgb(): convert = wavelength2rgb(500) assert convert[0] == 0.0 and convert[1] == 1.0 and convert[2] != 0.0 + convert = wavelength2rgb(510) + assert convert[0] == 0.0 and convert[1] == 1.0 and convert[2] == 0.0 + convert = wavelength2rgb(600) assert convert[0] == 1.0 and convert[2] == 0.0 and convert[1] != 0.0