mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 17:24:20 +02:00
move
This commit is contained in:
12
src/_impl/_catmull_rom_spline.scad
Normal file
12
src/_impl/_catmull_rom_spline.scad
Normal file
@@ -0,0 +1,12 @@
|
||||
use <bezier_curve.scad>;
|
||||
|
||||
function _catmull_rom_spline_4pts(t_step, points, tightness) =
|
||||
let(
|
||||
p1x_0tightness = (points[2] - points[0]) / 4 + points[1],
|
||||
v_p1x = points[1] - p1x_0tightness,
|
||||
p1x = p1x_0tightness + v_p1x * tightness,
|
||||
p2x_0tightness = (points[1] - points[3]) / 4 + points[2],
|
||||
v_p2x = points[2] - p2x_0tightness,
|
||||
p2x = p2x_0tightness + v_p2x * tightness
|
||||
)
|
||||
bezier_curve(t_step, [points[1], p1x, p2x, points[2]]);
|
@@ -1,15 +1,4 @@
|
||||
use <bezier_curve.scad>;
|
||||
|
||||
function _catmull_rom_spline_4pts(t_step, points, tightness) =
|
||||
let(
|
||||
p1x_0tightness = (points[2] - points[0]) / 4 + points[1],
|
||||
v_p1x = points[1] - p1x_0tightness,
|
||||
p1x = p1x_0tightness + v_p1x * tightness,
|
||||
p2x_0tightness = (points[1] - points[3]) / 4 + points[2],
|
||||
v_p2x = points[2] - p2x_0tightness,
|
||||
p2x = p2x_0tightness + v_p2x * tightness
|
||||
)
|
||||
bezier_curve(t_step, [points[1], p1x, p2x, points[2]]);
|
||||
use <_impl/_catmull_rom_spline.scad>;
|
||||
|
||||
function catmull_rom_spline(t_step, points, tightness = 0) =
|
||||
let(leng = len(points))
|
||||
@@ -25,7 +14,7 @@ function catmull_rom_spline(t_step, points, tightness = 0) =
|
||||
);
|
||||
|
||||
/*
|
||||
use <experimental/catmull_rom_spline.scad>;
|
||||
use <catmull_rom_spline.scad>;
|
||||
use <hull_polyline3d.scad>;
|
||||
|
||||
pts = [
|
@@ -4,7 +4,10 @@ to_do:
|
||||
|
||||
next:
|
||||
|
||||
- vx_contour
|
||||
- maze/*
|
||||
- vx_contour
|
||||
- polygon_hull
|
||||
- polyhedron_hull
|
||||
- polyhedron_hull
|
||||
- catmull_rom_spline
|
||||
- bauer_spiral
|
||||
- fibonacci_lattice
|
Reference in New Issue
Block a user