Public
Edited
Sep 12, 2023
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
toolDiameter = 0.25
Insert cell
maxToolDepth = 1
Insert cell
baseThickness = thickness - maxToolDepth
Insert cell
yOffset = maxToolDepth / 2
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Uncomment if you want to render intermediate steps to the space
// {
// fVizSpace.scene.add(samplePoints);
// fVizSpace.threeRenderScene();
// invalidation.then((_) => {
// fVizSpace.scene.remove(samplePoints);
// fVizSpace.threeRenderScene();
// });
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mutable test = 0
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
gp2Points = {
var n = 256,
m = 256,
values = new Array(n * m);
for (var j = 0.5, k = 0; j < m; ++j) {
for (var i = 0.5; i < n; ++i, ++k) {
values[k] = goldsteinPrice((i / n) * 4 - 2, 1 - (j / m) * 3);
}
}
return values;
}
Insert cell
contours = d3
.contours()
.size([256, 256])
.thresholds(Array.from({ length: 19 }, (_, i) => Math.pow(2, i + 2)))(
gp2Points
)
Insert cell
Insert cell
Insert cell
42
Insert cell
import {
serverUrl,
socket,
latestMessage,
toggleSocketButton,
availableEndMills,
invalidEndMillsForMaterial,
setMachineStateParameter,
sendRegionDims,
sendThickness,
sbpButton,
sendInstsToOverlay,
sendParamsToOverlay,
feedSpeedTable,
generateChecklist
// VisualizationSpace,
// VisualizationInterpreters
} from "@jtranoleary/woodgrain-authoring"
Insert cell
socket
Insert cell
toggleSocketButton
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rampSpeed = 1.0
Insert cell
completeInstructions = {
// NOTE: the second argument sets the Z-feedrate, which we might normally half
// of the XY-feedrate, but here we found that unintentionally limiting for 3d
// milling of foam, so we set it to equal the XY-feedrate.
const setFeed = `MS,${feed},${feed},,,`;
const setSpeed = `TR,${speed}`;
const setRamps = `VR,${rampSpeed},${rampSpeed},,,,,,,,`;
const spindleOn = "C6";
const spindleOff = "C7";
const moveHome = "MH";
let firstXy = extractXy(flippedToolpath[0]);
let moveToFirstPoint = `M2,${firstXy.x},${firstXy.y}`;
let initialPlunge = `MZ,${extractZ(flippedToolpath[0]).z}`;
let preamble = [
setFeed,
setSpeed,
setRamps,
spindleOn,
moveToFirstPoint,
initialPlunge
];
let epilogue = [spindleOff, moveHome];
return preamble.concat(flippedToolpath).concat(epilogue);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more