Skip to content

Commit b51858f

Browse files
authored
fix gear examples (#1423)
1 parent b479c67 commit b51858f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bindings/wasm/test/examples/gear-bearing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ringNode.material = {
6666
const sunNode = new GLTFNode(shift);
6767
sunNode.manifold = sun;
6868
sunNode.rotation =
69-
(t) => [0, 0, (np + 1) * 180 * m / ns + (t * 360) * (ns + np) * 2 / ns]
69+
(t) => [0, 0, (np + 1) * 180 / ns + (t * 360) * (ns + np) * 2 / ns]
7070
sunNode.material = {
7171
baseColorFactor: [0.7, 0.7, 0.7]
7272
};

bindings/wasm/test/examples/involute-gear-library.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export function gear2D(teeth: number, {
6666
const backlashDeg = clearance / (pitchRadius * cos(pressureRad)) * 180 / PI;
6767
const halfThickDeg = 90 / teeth - backlashDeg / 2;
6868

69+
if (halfThickDeg <= 0) {
70+
throw new Error('Clearance is too large for the circular pitch.');
71+
}
72+
6973
const pitchPoint =
7074
involute(baseRadius, involuteIntersectRad(baseRadius, pitchRadius));
7175
const pitchDeg = atan2(pitchPoint[1], pitchPoint[0]) * 180 / PI;

0 commit comments

Comments
 (0)