dhart.viewanalysis.SphericalViewAnalysisAggregate

dhart.viewanalysis.SphericalViewAnalysisAggregate(bvh: EmbreeBVH, nodes: List[Tuple[float, float, float]] | NodeList, ray_count: int, height: float, upward_fov=50, downward_fov=70, agg_type: AggregationType = AggregationType.SUM) ViewAnalysisAggregates

Conduct view analysis on every node in nodes and aggregate the results

ray_count rays are evenly distributed around each node in nodes and cast at the geometry in bvh. Hits are collected then summarized using the provided aggregation method. The actual number of rays cast may be slightly more or less than the amount specified, based on the fov limitations specified.

Parameters:
  • bvh – the BVH for the geometry you’re shooting at

  • nodes – A list of tuples containing x,y,z coordinates of points to analyze

  • ray_count – Amount of rays to shoot

  • height – height to offset nodes from the ground in meters

  • upward_fov – maximum angle up from the user’s eyelevel to be considred

  • downward_fov – maximum angle below from the user’s eyelevel to be considred

  • AT – aggregation method to use for distance.

Examples

Cast 150 rays for 3 nodesat 1.7m, then get the sum of the distance to every hit for all three

>>> from dhart.geometry import CommonRotations
>>> from dhart.raytracer import EmbreeBVH
>>> from dhart.geometry.mesh_info import ConstructPlane
>>> from dhart.viewanalysis import SphericalViewAnalysisAggregate, AggregationType
>>> MI = ConstructPlane()
>>> MI.Rotate(CommonRotations.Zup_to_Yup)
>>> BVH = EmbreeBVH(MI)
>>> origins = [(0,0,1), (1,0,1), (2,0,50)]
>>> va = SphericalViewAnalysisAggregate(BVH, origins, 100, 1.7, agg_type=AggregationType.SUM)
>>> print(va)
[95.05698 73.62985  0.     ]

Cast 150 rays for 3 nodesat 1.7m, then get the average distance for all three

>>> from dhart.geometry import CommonRotations
>>> from dhart.raytracer import EmbreeBVH
>>> from dhart.geometry.mesh_info import ConstructPlane
>>> from dhart.viewanalysis import SphericalViewAnalysisAggregate, AggregationType
>>> MI = ConstructPlane()
>>> MI.Rotate(CommonRotations.Zup_to_Yup)
>>> BVH = EmbreeBVH(MI)
>>> origins = [(0,0,1), (1,0,1), (2,0,50)]
>>> va = SphericalViewAnalysisAggregate(BVH, origins, 100, 1.7, agg_type=AggregationType.AVERAGE)
>>> print(va)
[4.5265236 4.3311677 0.       ]
Returns:

view analysis scores resulting from the view analysis calculation

Return type:

ViewAnalysisAggregates