photonmap.Loader.LoadCaptor
Classes
A class which contains all the data of captor. |
Functions
|
Adds virtual captors to the scene. |
|
Adds face captors to the scene. |
|
Find the index of a disk shape captor while knowing its position |
|
Add the captors to the PlantGL scene to visualize the scene |
Module Contents
- class photonmap.Loader.LoadCaptor.Captor[source]
A class which contains all the data of captor.
Attributes
- xSite: float
The X coordinate of captor’s position
- ySite: float
The Y coordinate of captor’s position
- zSite: float
The Z coordinate of captor’s position
- xNormal: float
The X coordinate of captor’s normal
- yNormal: float
The Y coordinate of captor’s normal
- zNormal: float
The Z coordinate of captor’s normal
- radius: float
The radius of captor
- vertices: array
The vertices of captor’s geometry
- normals: array
The normal vectors of each vertices in captor’s geometry
- triangles: array
The triangles of captor’s geometry
- initCaptor(shape, position, scale_factor, captor_type)[source]
Init a object of face captor
Returns
- shape: Shape
The geometry and material of captor
- positiontuple(int,int,int)
The position of captor
- scale_factor: int
The size of geometries. The vertices of geometries is recalculated by dividing their coordinates by this value
- captor_type: str
“VirtualCaptor” or “FaceCaptor”
- initVirtualDiskCaptor(pos=(0, 0, 0), nor=(0, 0, 0), r=0, captor_id=0)[source]
Init a object of virtual disk shape captor
Returns
- pos: tuple
The position of captor
- nor: tuple
The normal vector of captor
- r: float
The radius of captor
- captor_id: int
The id of captor
- createVirtualDisk()[source]
Create geometry of circular captor
Returns
- vertices: array
The vertices of captor’s geometry
- normals: array
The normal vectors of each vertices in captor’s geometry
- triangles: array
The triangles of captor’s geometry
- equal(xSite, ySite, zSite)[source]
Check if the coordinate is equal to the position of captor
Parameters
- xSite: float
The X coordinate
- ySite: float
The Y coordinate
- zSite: float
The Z coordinate
Returns
True if equal False if not equal
- photonmap.Loader.LoadCaptor.addVirtualCaptors(scene, virtual_captor_triangle_dict, list_virtual_captor)[source]
Adds virtual captors to the scene.
Parameters
- scenelibphotonmap_core.Scene
The photon mapping scene used to run the simulation
- virtual_captor_triangle_dictdict
The dictionary of the triangles of captors
- list_virtual_captorarray
The list of virtual captor
Returns
Add all the mesh of virtual captors to the scene
- photonmap.Loader.LoadCaptor.addFaceCaptors(scene, face_captor_triangle_dict, list_face_captor)[source]
Adds face captors to the scene.
Parameters
- scenelibphotonmap_core.Scene
The photon mapping scene used to run the simulation
- face_captor_triangle_dictdict
The dictionary of the triangles of captors
- list_face_captorarray
The list of face captor
Returns
Add all the mesh of face captors to the scene
- photonmap.Loader.LoadCaptor.findIndexOfDiskCaptorInList(list_captor, x, y, z)[source]
Find the index of a disk shape captor while knowing its position
Parameters
- list_captorArray
The list of the captor in the scene
- xfloat
x coordinate
- yfloat
y coordinate
- zfloat
z coordinate
Returns
if not found, return -1 if found, return the index of the captor