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
- contour tabs support
- flat render
- path arrows
- help dialog
- full bug reports
@ -9,9 +10,9 @@ NEXT
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
* `F` 2D image import
* `F` detect and report slow framerates
* `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` duplicate objects should share same slice data unless rotated or scaled
* `P` worker state cache cleanup and organization

View file

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

View file

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

View file

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