add todo notes
This commit is contained in:
parent
8c4f4198be
commit
ce2d9b38a8
2 changed files with 6 additions and 7 deletions
|
|
@ -84,6 +84,8 @@ class OpArea extends CamOp {
|
||||||
// add in unioned surface areas
|
// add in unioned surface areas
|
||||||
polys.push(...POLY.setZ(POLY.union(fpoly, 0.00001, true), fminz));
|
polys.push(...POLY.setZ(POLY.union(fpoly, 0.00001, true), fminz));
|
||||||
|
|
||||||
|
// todo: implement `refine` and `smooth`
|
||||||
|
|
||||||
// expand selections (flattens z variable polys)
|
// expand selections (flattens z variable polys)
|
||||||
if (Math.abs(expand) > 0) {
|
if (Math.abs(expand) > 0) {
|
||||||
let nupolys = polys.filter(p => p.open); // set aside open
|
let nupolys = polys.filter(p => p.open); // set aside open
|
||||||
|
|
@ -225,7 +227,7 @@ class OpArea extends CamOp {
|
||||||
paths = paths.map(poly => poly.points.map(p => [ p.x, p.y ]).flat().toFloat32());
|
paths = paths.map(poly => poly.points.map(p => [ p.x, p.y ]).flat().toFloat32());
|
||||||
} else
|
} else
|
||||||
if (sr_type === 'offset') {
|
if (sr_type === 'offset') {
|
||||||
// progressive inset from perimeter
|
// todo: progressive inset from perimeter
|
||||||
console.log({ sr_offset: toolOver });
|
console.log({ sr_offset: toolOver });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -259,6 +261,8 @@ class OpArea extends CamOp {
|
||||||
});
|
});
|
||||||
raster.terminate();
|
raster.terminate();
|
||||||
|
|
||||||
|
// todo: port clever bits from topo3 for inside/outside detection and tab clipping
|
||||||
|
|
||||||
// convert terrain raster output back to open polylines
|
// convert terrain raster output back to open polylines
|
||||||
for (let path of output.paths) {
|
for (let path of output.paths) {
|
||||||
path = newPolygon().fromArray([1, ...path]);
|
path = newPolygon().fromArray([1, ...path]);
|
||||||
|
|
@ -347,7 +351,6 @@ class OpArea extends CamOp {
|
||||||
function scanBoxAtAngle(box2, angle, step) {
|
function scanBoxAtAngle(box2, angle, step) {
|
||||||
const cx = (box2.min.x + box2.max.x) * 0.5;
|
const cx = (box2.min.x + box2.max.x) * 0.5;
|
||||||
const cy = (box2.min.y + box2.max.y) * 0.5;
|
const cy = (box2.min.y + box2.max.y) * 0.5;
|
||||||
|
|
||||||
const w = box2.max.x - box2.min.x;
|
const w = box2.max.x - box2.min.x;
|
||||||
const h = box2.max.y - box2.min.y;
|
const h = box2.max.y - box2.min.y;
|
||||||
|
|
||||||
|
|
@ -370,13 +373,11 @@ function scanBoxAtAngle(box2, angle, step) {
|
||||||
|
|
||||||
const halfSpan = step * (count - 1) * 0.5;
|
const halfSpan = step * (count - 1) * 0.5;
|
||||||
const halfD = extentD * 0.5;
|
const halfD = extentD * 0.5;
|
||||||
|
|
||||||
const rays = [];
|
const rays = [];
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// offset along normal
|
// offset along normal
|
||||||
const o = -halfSpan + i * step;
|
const o = -halfSpan + i * step;
|
||||||
|
|
||||||
const ox = cx + nx * o;
|
const ox = cx + nx * o;
|
||||||
const oy = cy + ny * o;
|
const oy = cy + ny * o;
|
||||||
|
|
||||||
|
|
@ -387,10 +388,8 @@ function scanBoxAtAngle(box2, angle, step) {
|
||||||
const by = oy + dy * halfD;
|
const by = oy + dy * halfD;
|
||||||
|
|
||||||
rays.push({
|
rays.push({
|
||||||
origin: new THREE.Vector2(ox, oy),
|
|
||||||
a: new THREE.Vector2(ax, ay),
|
a: new THREE.Vector2(ax, ay),
|
||||||
b: new THREE.Vector2(bx, by),
|
b: new THREE.Vector2(bx, by),
|
||||||
length: extentD
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ export class Topo {
|
||||||
if (poly.length > 1) {
|
if (poly.length > 1) {
|
||||||
lines.push(poly);
|
lines.push(poly);
|
||||||
}
|
}
|
||||||
// raize output points when inside tab boundaries
|
// raise output points when inside tab boundaries
|
||||||
if (!inside && tabsOn && clipTab.length)
|
if (!inside && tabsOn && clipTab.length)
|
||||||
for (let poly of lines) {
|
for (let poly of lines) {
|
||||||
for (let p of poly.points) {
|
for (let p of poly.points) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue