1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 20:10:36 +02:00

removed triangle indexes

This commit is contained in:
Justin Lin
2017-05-10 16:54:20 +08:00
parent 02e5de5a08
commit 6f092f4dee
2 changed files with 7 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
# shape_square # shape_square
Returns shape points and triangle indexes of a rounded square or rectangle. 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 rounded square or rectangle. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module.
## Parameters ## Parameters
@@ -13,7 +13,7 @@ Returns shape points and triangle indexes of a rounded square or rectangle. They
include <shape_square.scad>; include <shape_square.scad>;
polygon( polygon(
shape_square(size = 50, corner_r = 5)[0] shape_square(size = 50, corner_r = 5)
); );
![shape_square](images/lib-shape_square-1.JPG) ![shape_square](images/lib-shape_square-1.JPG)
@@ -26,15 +26,14 @@ Returns shape points and triangle indexes of a rounded square or rectangle. They
$fn = 36; $fn = 36;
shape_pts_angles = shape_square( shape_pts = shape_square(
size = [20, 10], size = [20, 10],
corner_r = 2 corner_r = 2
); );
ring_extrude( ring_extrude(
shape_pts_angles[0], shape_pts,
radius = 50, angle = 180, twist = 180, scale = 2, radius = 50, angle = 180, twist = 180, scale = 2
triangles = shape_pts_angles[1]
); );
![shape_square](images/lib-shape_square-2.JPG) ![shape_square](images/lib-shape_square-2.JPG)

View File

@@ -14,7 +14,6 @@
include <__private__/__is_vector.scad>; include <__private__/__is_vector.scad>;
include <__private__/__frags.scad>; include <__private__/__frags.scad>;
include <__private__/__triangles_radial.scad>;
function shape_square(size, corner_r = 0) = function shape_square(size, corner_r = 0) =
let( let(
@@ -37,10 +36,5 @@ function shape_square(size, corner_r = 0) =
[for(a = [180 + step_a:step_a:270 - step_a]) [corner_r * cos(a) - half_w, corner_r * sin(a) - half_h]], [for(a = [180 + step_a:step_a:270 - step_a]) [corner_r * cos(a) - half_w, corner_r * sin(a) - half_h]],
[[-half_w, -half_y], [half_w, -half_y]], [[-half_w, -half_y], [half_w, -half_y]],
[for(a = [270 + step_a:step_a:360 - step_a]) [corner_r * cos(a) + half_w, corner_r * sin(a) - half_h]] [for(a = [270 + step_a:step_a:360 - step_a]) [corner_r * cos(a) + half_w, corner_r * sin(a) - half_h]]
), )
triangles = __triangles_radial(shape_pts) ) shape_pts;
)
[
shape_pts,
triangles
];