mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 02:04:16 +02:00
added shape_ellipse
This commit is contained in:
16
src/shape_ellipse.scad
Normal file
16
src/shape_ellipse.scad
Normal file
@@ -0,0 +1,16 @@
|
||||
function shape_ellipse(axes) =
|
||||
let(
|
||||
frags = $fn > 0 ?
|
||||
($fn >= 3 ? $fn : 3) :
|
||||
max(min(360 / $fa, axes[0] * 6.28318 / $fs), 5),
|
||||
step_a = 360 / frags,
|
||||
shape_pts = [
|
||||
for(a = [0:step_a:360 - step_a])
|
||||
[axes[0] * cos(a), axes[1] * sin(a)]
|
||||
],
|
||||
triangles = [for(i = [1:len(shape_pts) - 2]) [0, i, i + 1]]
|
||||
)
|
||||
[
|
||||
shape_pts,
|
||||
triangles
|
||||
];
|
Reference in New Issue
Block a user