NREL / floorspace.js

Other
66 stars 35 forks source link

Problem with grid size under 1 unity #336

Closed Jopenergy closed 5 years ago

Jopenergy commented 5 years ago

When grid spacing is under unity (for example 0.1ft or 0.1m), there is a bug when trying to intersect two spaces.

  1. let's draw a space on the 0.1ft grid : bug-grid-1

  2. we can check that the space is not snapped on the 1ft grid: bug-grid-2

  3. now, let's go back to the 0.1ft grid and draw a new space on this 0.1ft grid. The new space is ok: the vertices are on the the 0.1ft grid. However, the old space is modified: bug-grid-3

  4. going back to the 1ft grid, we can check that the old space has been automatically modified to snap to the 1ft grid, without any reason... bug-grid-4

  5. in order to make sure that the problem comes from the 0.1ft grid, we do the same workflow but starting with a 1ft grid. In this cas, everything works properly: image

Thank you for your help!

DavidGoldwasser commented 5 years ago

I'm hitting this as well with 2.5' grid. I have video if interested but here are few screenshots. Note, while my grid is larger than 1, it isn't a multiple of 1. I do see same issue with grid size of 0.5'.

I started with rectangle of entire footprint then started drawing new spaces that cut into that. It over-cuts to whole foot leaving a gap. If I try to fill the gap by enlarging the primary space then it goes past my grid the other direction.

screen shot 2018-11-07 at 2 49 01 pm

screen shot 2018-11-07 at 1 26 46 pm

bgschiller commented 5 years ago

This has been implemented and is live on develop. We've added tests that use sub-unit grid sizes.