1
0
Fork 0

fix(cornelius): Raise is not log

This commit is contained in:
joostdecock 2022-09-11 18:12:08 +02:00
parent c43802c02b
commit cb6bd247e4
3 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@ import { frontpoints } from './frontpoints.mjs'
import { front } from './front.mjs'
function rotateDistanceForP3(part, point, distance, center) {
let { options, Path, points, paths, store, raise } = part.shorthand()
let { options, Path, points, paths, store, log } = part.shorthand()
let length = store.get('insideSeam')
@ -60,12 +60,12 @@ function rotateDistanceForP3(part, point, distance, center) {
} while ((dOffset > 0.1 || dOffset < -0.1 || dLength < -0.1 || dLength > 0.1) && iteration < 100)
if (iteration >= 100) {
raise.error('Could not find a point for "3" within 100 iterations')
log.error('Could not find a point for "3" within 100 iterations')
}
}
function rotateDistanceForP4(part, point, distance, center, origin) {
let { options, Path, points, paths, store, raise } = part.shorthand()
let { options, Path, points, paths, store, log } = part.shorthand()
let aCPu,
aCPj,
@ -171,7 +171,7 @@ function rotateDistanceForP4(part, point, distance, center, origin) {
} while ((dOffset > 0.1 || dOffset < -0.1 || dLength > 0.1 || dLength < -0.1) && iteration < 100)
if (iteration >= 100) {
raise.error('Could not find a point for "4" within 100 iterations')
log.error('Could not find a point for "4" within 100 iterations')
}
}

View file

@ -6,7 +6,7 @@ function draftCorneliusFrontpoints({
points,
paths,
store,
raise,
log,
part,
}) {
let halfInch = measurements.waistToKnee / 48
@ -48,14 +48,14 @@ function draftCorneliusFrontpoints({
if (null != tPoints && tPoints.length > 0) {
points.pS = tPoints[0].clone()
} else {
raise.error('Something is not quite right here!')
log.error('Something is not quite right here!')
}
tPath = new Path().move(points.pG).line(points.pX)
tPoints = tPath.intersectsY(points.pT.y)
if (null != tPoints && tPoints.length > 0) {
points.pZ = tPoints[0].clone()
} else {
raise.error('Could not find an intersection to create the crotch point Z')
log.error('Could not find an intersection to create the crotch point Z')
}
points.pP = points.pE.shift(180, seat / 3)

View file

@ -2,7 +2,7 @@ import { front } from './front.mjs'
import { back } from './back.mjs'
function findR(part, height, arcLength) {
let { raise } = part.shorthand()
let { log } = part.shorthand()
let iter = 0
let a = 0.5
@ -19,7 +19,7 @@ function findR(part, height, arcLength) {
//console.log( {iter, diff, a} );
} while ((diff < -1 || diff > 1) && iter < 50)
if (iter >= 500) {
raise.error('Could not find the radius for the legband within 500 iterations')
log.error('Could not find the radius for the legband within 500 iterations')
}
return a * (180 / Math.PI)