fix z bottom for topo

This commit is contained in:
Stewart Allen 2020-11-12 08:42:18 -05:00
commit 951bd7ec41
4 changed files with 8 additions and 12 deletions

View file

@ -2,6 +2,7 @@
NEXT NEXT
- contour tabs support - contour tabs support
- flat render
- path arrows - path arrows
- help dialog - help dialog
- full bug reports - full bug reports
@ -9,9 +10,9 @@ NEXT
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix ## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
* `F` 2D image import
* `F` detect and report slow framerates * `F` detect and report slow framerates
* `F` implement an in-app bug reporting system. add workspace to export option. * `F` implement an in-app bug reporting system. add workspace to export option.
* `F` 2D image import
* `P` improve decimation speed by avoiding in/out of Point? * `P` improve decimation speed by avoiding in/out of Point?
* `P` duplicate objects should share same slice data unless rotated or scaled * `P` duplicate objects should share same slice data unless rotated or scaled
* `P` worker state cache cleanup and organization * `P` worker state cache cleanup and organization

View file

@ -1,6 +1,6 @@
{ {
"name": "grid-apps", "name": "grid-apps",
"version": "2.3.D6", "version": "2.3.D7",
"description": "grid.space 3d slice & modeling tools", "description": "grid.space 3d slice & modeling tools",
"author": "Stewart Allen <sa@grid.space>", "author": "Stewart Allen <sa@grid.space>",
"license": "MIT", "license": "MIT",

View file

@ -3,7 +3,7 @@
let terms = { let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved", COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE: "See the license.md file included with the source distribution", LICENSE: "See the license.md file included with the source distribution",
VERSION: "2.3.D6" VERSION: "2.3.D7"
}; };
if (typeof(module) === 'object') { if (typeof(module) === 'object') {

View file

@ -36,6 +36,7 @@
minY = bounds.min.y, minY = bounds.min.y,
maxY = bounds.max.y, maxY = bounds.max.y,
zBottom = proc.camZBottom, zBottom = proc.camZBottom,
zMin = Math.max(bounds.min.z, zBottom) + 0.0001,
boundsX = maxX - minX, boundsX = maxX - minX,
boundsY = maxY - minY, boundsY = maxY - minY,
maxangle = proc.camContourAngle, maxangle = proc.camContourAngle,
@ -86,17 +87,12 @@
let ty = profile[i++] + y; let ty = profile[i++] + y;
let tz = profile[i++]; let tz = profile[i++];
if (tx < 0 || tx > xl || ty < 0 || ty > yl) { if (tx < 0 || tx > xl || ty < 0 || ty > yl) {
// if outside max topo steps, use 0 // if outside max topo steps, use zMin
gv = 0; gv = zMin;
} else { } else {
// lookup grid value @ tx, ty // lookup grid value @ tx, ty
gv = topo.data[tx * sy + ty] || 0; gv = topo.data[tx * sy + ty] || zMin;
} }
// inside the topo but off the part
// if (floormax && gv === 0) {
// // return topo.bounds.max.z;
// gv = topo.bounds.max.z;
// }
// update the rest // update the rest
mz = Math.max(tz + gv, mz); mz = Math.max(tz + gv, mz);
} }
@ -142,7 +138,6 @@
gridy, gridy,
gridi, // index gridi, // index
gridv, // value gridv, // value
zMin = Math.max(bounds.min.z, zBottom) + 0.0001,
x, y, tv, ltv; x, y, tv, ltv;
// for each Y slice, find z grid value (x/z swapped) // for each Y slice, find z grid value (x/z swapped)