Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(model): Ensure Mesh3D and Face3D in ContextShade interpret correctly #200

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dragonfly_uwg/properties/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,11 @@ def _autocalcualted_tree_coverage(self, ground_area):
veg_shds, mesh_area = [], 0
for shd in self.host.context_shades:
if shd.properties.uwg.is_vegetation:
if isinstance(shd.geometry, Face3D):
veg_shds.extend(shd.geometry)
else:
mesh_area += shd.geometry.area
for shd_geo in shd.geometry:
if isinstance(shd_geo, Face3D):
veg_shds.append(shd_geo)
else:
mesh_area += shd_geo.area
tree_area = self.compute_horizontal_area(veg_shds) + mesh_area
if ground_area <= 0:
return 0
Expand Down
Loading