1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-17 20:11:50 +02:00

extract gcd lcm

This commit is contained in:
Justin Lin
2020-03-01 18:28:08 +08:00
parent 7c03032564
commit b92eafd9ea
3 changed files with 5 additions and 4 deletions

View File

@@ -0,0 +1 @@
function gcd(m, n) = n == 0 ? m : gcd(n, m % n);

View File

@@ -0,0 +1,3 @@
use <experimental/gcd.scad>;
function lcm(m, n) = m * n / gcd(m, n);

View File

@@ -1,10 +1,7 @@
use <experimental/lcm.scad>;
use <experimental/sweep.scad>;
module loft(sections, slices = 1) {
function gcd(m, n) = n == 0 ? m : gcd(n, m % n);
function lcm(m, n) = m * n / gcd(m, n);
function inter_pts(p1, p2, n) =
let(
v = p2 - p1,