mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 22:28:16 +01:00
removed triangle indexes
This commit is contained in:
parent
02e5de5a08
commit
6f092f4dee
@ -1,6 +1,6 @@
|
||||
# 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
|
||||
|
||||
@ -13,7 +13,7 @@ Returns shape points and triangle indexes of a rounded square or rectangle. They
|
||||
include <shape_square.scad>;
|
||||
|
||||
polygon(
|
||||
shape_square(size = 50, corner_r = 5)[0]
|
||||
shape_square(size = 50, corner_r = 5)
|
||||
);
|
||||
|
||||
![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;
|
||||
|
||||
shape_pts_angles = shape_square(
|
||||
shape_pts = shape_square(
|
||||
size = [20, 10],
|
||||
corner_r = 2
|
||||
);
|
||||
|
||||
ring_extrude(
|
||||
shape_pts_angles[0],
|
||||
radius = 50, angle = 180, twist = 180, scale = 2,
|
||||
triangles = shape_pts_angles[1]
|
||||
shape_pts,
|
||||
radius = 50, angle = 180, twist = 180, scale = 2
|
||||
);
|
||||
|
||||
![shape_square](images/lib-shape_square-2.JPG)
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
include <__private__/__is_vector.scad>;
|
||||
include <__private__/__frags.scad>;
|
||||
include <__private__/__triangles_radial.scad>;
|
||||
|
||||
function shape_square(size, corner_r = 0) =
|
||||
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]],
|
||||
[[-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]]
|
||||
),
|
||||
triangles = __triangles_radial(shape_pts)
|
||||
)
|
||||
[
|
||||
shape_pts,
|
||||
triangles
|
||||
];
|
||||
)
|
||||
) shape_pts;
|
Loading…
x
Reference in New Issue
Block a user