mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 22:28:16 +01:00
rename
This commit is contained in:
parent
08060db897
commit
ef6a1d1d1c
@ -1,7 +1,7 @@
|
|||||||
use <golden_spiral.scad>;
|
use <golden_spiral.scad>;
|
||||||
use <ptf/ptf_rotate.scad>;
|
use <ptf/ptf_rotate.scad>;
|
||||||
use <triangle/tri_delaunay.scad>;
|
use <triangle/tri_delaunay.scad>;
|
||||||
use <triangle/tri_incentre.scad>;
|
use <triangle/tri_incenter.scad>;
|
||||||
use <util/dedup.scad>;
|
use <util/dedup.scad>;
|
||||||
|
|
||||||
spirals = 2;
|
spirals = 2;
|
||||||
@ -35,7 +35,7 @@ module delaunay_fibonacci() {
|
|||||||
cells = tri_delaunay(pts, ret = "TRI_SHAPES");
|
cells = tri_delaunay(pts, ret = "TRI_SHAPES");
|
||||||
for(i = [0:len(cells) - 1]) {
|
for(i = [0:len(cells) - 1]) {
|
||||||
cell = cells[i];
|
cell = cells[i];
|
||||||
p = tri_incentre(cell);
|
p = tri_incenter(cell);
|
||||||
|
|
||||||
color(rands(0, 1, 3))
|
color(rands(0, 1, 3))
|
||||||
translate(p)
|
translate(p)
|
||||||
|
13
src/triangle/tri_incenter.scad
Normal file
13
src/triangle/tri_incenter.scad
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
function tri_incenter(shape_pts) =
|
||||||
|
let(
|
||||||
|
pa = shape_pts[0],
|
||||||
|
pb = shape_pts[1],
|
||||||
|
pc = shape_pts[2],
|
||||||
|
a = norm(pb - pc),
|
||||||
|
b = norm(pc - pa),
|
||||||
|
c = norm(pa - pb)
|
||||||
|
)
|
||||||
|
[
|
||||||
|
(a * pa[0] + b * pb[0] + c * pc[0]),
|
||||||
|
(a * pa[1] + b * pb[1] + c * pc[1])
|
||||||
|
] / (a + b + c);
|
Loading…
x
Reference in New Issue
Block a user