Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function parametric_points(fx, fy, t0=0, t1=10, delta=0.01)
= [for(i = [t0:delta:t1]) [fx(i), fy(i)]];
function reverse(vector)
= [for(i = [1:len(vector)]) vector[len(vector) - i]];
x = function(t) t;
y = function(t) -2 * pow(t, 2) + 2;
y2 = function(t) y(t) + .25;
points_1 = parametric_points(fx=x, fy=y, t0=-1, t1=1);
points_2 = parametric_points(fx=x, fy=y2,t0=-1, t1=1);
color("lime")
linear_extrude(2)
union() {
polygon(
concat(
points_1,
points_2
)
);
translate([0,0 + 0.1,0])
square(center=true, [2,1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.