From b0a1b93b0f2c0513f689e7f42f63c621dbd25c93 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 10 May 2017 16:59:41 +0800 Subject: [PATCH] removed triangle indexes --- docs/lib-shape_superformula.md | 25 ++++++++++++------------- src/shape_superformula.scad | 10 ++-------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/docs/lib-shape_superformula.md b/docs/lib-shape_superformula.md index 02bf4e6a..111a892a 100644 --- a/docs/lib-shape_superformula.md +++ b/docs/lib-shape_superformula.md @@ -1,6 +1,6 @@ # shape_superformula -Returns shape points and triangle indexes of a [Superformula](https://en.wikipedia.org/wiki/Superformula) shape. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module. +Returns shape points of a [Superformula](https://en.wikipedia.org/wiki/Superformula) shape. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module. ## Parameters @@ -13,22 +13,22 @@ Returns shape points and triangle indexes of a [Superformula](https://en.wikiped phi_step = 0.05; - polygon(shape_superformula(phi_step, 3, 3, 4.5, 10, 10)[0]); + polygon(shape_superformula(phi_step, 3, 3, 4.5, 10, 10)); translate([3, 0]) - polygon(shape_superformula(phi_step, 4, 4, 12, 15, 15)[0]); + polygon(shape_superformula(phi_step, 4, 4, 12, 15, 15)); translate([6, 0]) - polygon(shape_superformula(phi_step, 7, 7, 10, 6, 6)[0]); + polygon(shape_superformula(phi_step, 7, 7, 10, 6, 6)); translate([9, 0]) - polygon(shape_superformula(phi_step, 5, 5, 4, 4, 4)[0]); + polygon(shape_superformula(phi_step, 5, 5, 4, 4, 4)); translate([0, -4]) - scale(0.8) polygon(shape_superformula(phi_step, 5, 5, 2, 7, 7)[0]); + scale(0.8) polygon(shape_superformula(phi_step, 5, 5, 2, 7, 7)); translate([3, -4]) - scale(0.25) polygon(shape_superformula(phi_step, 5, 5, 2, 13, 13)[0]); + scale(0.25) polygon(shape_superformula(phi_step, 5, 5, 2, 13, 13)); translate([6, -4]) - polygon(shape_superformula(phi_step, 4, 4, 1, 1, 1)[0]); + polygon(shape_superformula(phi_step, 4, 4, 1, 1, 1)); translate([9, -4]) - scale(0.3) polygon(shape_superformula(phi_step, 4, 4, 1, 7, 8)[0]); + scale(0.3) polygon(shape_superformula(phi_step, 4, 4, 1, 7, 8)); ![shape_superformula](images/lib-shape_superformula-1.JPG) @@ -46,15 +46,14 @@ Returns shape points and triangle indexes of a [Superformula](https://en.wikiped n = 0.5; n3 = 16; - shape_pts_tris = shape_superformula(phi_step, m, m, n, n, n3); + shape_pts = shape_superformula(phi_step, m, m, n, n, n3); golden_spiral_extrude( - shape_pts_tris[0], + shape_pts, from = 5, to = 10, point_distance = 2, - scale = 10, - triangles = shape_pts_tris[1] + scale = 10 ); ![shape_superformula](images/lib-shape_superformula-2.JPG) diff --git a/src/shape_superformula.scad b/src/shape_superformula.scad index c45aa1bd..a2139adc 100644 --- a/src/shape_superformula.scad +++ b/src/shape_superformula.scad @@ -14,7 +14,6 @@ include <__private__/__ra_to_xy.scad>; include <__private__/__to_degree.scad>; -include <__private__/__triangles_radial.scad>; function _superformula_r(angle, m1, m2, n1, n2 = 1, n3 = 1, a = 1, b = 1) = pow( @@ -34,11 +33,6 @@ function shape_superformula(phi_step, m1, m2, n1, n2 = 1, n3 = 1, a = 1, b = 1) ) __ra_to_xy(r, angle) ], - shape_pts = concat([[0, 0]], pts, [pts[0]]), - triangles = __triangles_radial(shape_pts) + shape_pts = concat([[0, 0]], pts, [pts[0]]) - ) - [ - shape_pts, - triangles - ]; \ No newline at end of file + ) shape_pts; \ No newline at end of file