Last active
January 19, 2020 04:35
-
-
Save SharpCoder/3c63781813ece0c1f139a414d33b1865 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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