Checkpoint restored book coordinate frame
This commit is contained in:
@@ -214,10 +214,11 @@ function rebuildBook() {
|
||||
const bundleCount = Math.max(4, Math.round(pageCount / 10));
|
||||
const spineWidth = calculateSpineWidth(bundleCount);
|
||||
const leftCount = calculateLeftBundleCount(bundleCount);
|
||||
const hingeX = spineWidth * 0.5 + HINGE_INSET;
|
||||
const foreEdgeX = spineWidth * 0.5 + pageWidth;
|
||||
const spineHalf = spineArcHalf(spineWidth);
|
||||
const hingeX = spineHalf + HINGE_INSET;
|
||||
const foreEdgeX = spineHalf + pageWidth;
|
||||
const bundleSpacing = calculateBundleSpacing(bundleCount, spineWidth, leftCount);
|
||||
activeSpineHalf = spineWidth * 0.5;
|
||||
activeSpineHalf = spineHalf;
|
||||
const lines = simulatePageLines(bundleCount, pageWidth, pageSplineLength, spineWidth, foreEdgeX, bundleSpacing, leftCount);
|
||||
lastLengthError = measureLineLengthError(lines, pageSplineLength);
|
||||
lastSpacingError = measureStackSpacingError(lines, bundleSpacing);
|
||||
@@ -245,7 +246,7 @@ function addCoverAssembly(pageWidth, depth, thickness, spineWidth) {
|
||||
}
|
||||
|
||||
function createCoverAssemblyGeometry(pageWidth, depth, thickness, spineWidth) {
|
||||
const spineHalf = spineWidth * 0.5;
|
||||
const spineHalf = spineArcHalf(spineWidth);
|
||||
const hingeX = spineHalf + HINGE_INSET;
|
||||
const outerX = spineHalf + pageWidth + COVER_OVERHANG;
|
||||
const outerTopY = BOOK_PROFILE.tableY + thickness;
|
||||
@@ -339,7 +340,7 @@ function createClothSpineGeometry(depth, spineWidth) {
|
||||
}
|
||||
|
||||
function spineCurvePoint(t, spineWidth) {
|
||||
const radiusX = spineWidth * 0.42;
|
||||
const radiusX = spineArcHalf(spineWidth);
|
||||
const radiusY = 0.018;
|
||||
const baseY = BOOK_PROFILE.tableY + BOOK_PROFILE.coverThickness + 0.002;
|
||||
const theta = Math.PI * (1 - THREE.MathUtils.clamp(t, 0, 1));
|
||||
@@ -350,6 +351,10 @@ function spineCurvePoint(t, spineWidth) {
|
||||
};
|
||||
}
|
||||
|
||||
function spineArcHalf(spineWidth) {
|
||||
return spineWidth * 0.42;
|
||||
}
|
||||
|
||||
function calculateSpineWidth(bundleCount) {
|
||||
const minimumWidth = 0.16;
|
||||
if (bundleCount <= 1) return minimumWidth;
|
||||
|
||||
Reference in New Issue
Block a user