Git Product home page Git Product logo

fff's People

Stargazers

 avatar

Watchers

 avatar

fff's Issues

rename to __get_voxel_object()

fff/voxelate/voxelate.py

Lines 187 to 199 in 92873d6

def get_voxel_object(self, voxel_geom, voxel_box, sun_centroid, voxel_condition):
voxel_geom_centroid = gh.Volume(voxel_geom).centroid
if voxel_condition in (self.EXTERIOR, self.ROOF):
vector = voxel_geom_centroid - self.exterior_unit_centroid
voxel_geom = gh.Move(self.rotated_exterior_unit, vector).geometry
return Voxel(
voxel_geom=voxel_geom,
voxel_box=voxel_box,
voxel_geom_centroid=voxel_geom_centroid,
voxel_condition=voxel_condition
)

make to `Enum`

fff/voxelate/voxelate.py

Lines 101 to 111 in 981306c

class VoxelConditions:
UNDEFINED = -1
NONE = 0
ROOF = 3
EXTERIOR = 4
EXTERIOR_BOTH = 5
EXTERIOR_CORNER = 6
EXTERIOR_CORNER_O = 7
EXTERIOR_CORNER_U = 8
INTERIOR = 9

  • but python 2.7 not support Enum. need simple implementation.

inculde `EXTERIOR_BOTH` condition within these lines

fff/voxelate/voxelate.py

Lines 322 to 331 in ec7a8e7

if bool(exterior_corner_conditions[xi]):
voxel_condition = self.EXTERIOR_CORNER
elif bool(exterior_corner_o_conditions[xi]):
voxel_condition = self.EXTERIOR_CORNER_O
elif bool(exterior_corner_u_conditions[xi]):
voxel_condition = self.EXTERIOR_CORNER_U
elif bool(exterior_conditions[xi]):
voxel_condition = self.EXTERIOR
elif bool(interior_conditions[xi]):
voxel_condition = self.INTERIOR

change `append` to `sum`

fff/voxelate/voxelate.py

Lines 436 to 442 in 84023ee

shade = []
for ov in voxels_geom_flattened:
intersects = rg.Intersect.Intersection.MeshLine(ov, ray)
if len(intersects) > 0:
shade.append(len(intersects))
y_voxels[vi].voxel_shade = sum(shade)

 shade = 0
 for ov in voxels_geom_flattened: 
     intersects = rg.Intersect.Intersection.MeshLine(ov, ray) 
     if len(intersects) > 0: 
         shade += len(intersects)
  
 y_voxels[vi].voxel_shade = shade)

need to three-dimensionalize `voxel_shade`

fff/voxelate/voxelate.py

Lines 417 to 436 in 69074b5

def __gen_voxel_shades(self):
if self.is_needed_shades:
voxels_geom_flattened = [v.voxel_geom for v in self.voxels_objects_flattened if v.voxel_condition != self.NONE]
for voxels in self.voxels_objects:
for y_voxels in voxels:
for vi, v in enumerate(y_voxels):
if (
v.voxel_condition == self.NONE
or v.voxel_condition not in (self.EXTERIOR, self.EXTERIOR_CORNER, self.ROOF)
):
continue
ray = rg.Line(self.sun_point, v.voxel_geom_centroid)
shade = 0
for ov in voxels_geom_flattened:
intersects = rg.Intersect.Intersection.MeshLine(ov, ray)
if len(intersects) > 0:
shade += len(intersects)
y_voxels[vi].voxel_shade = shade

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.