mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-01 04:20:27 +02:00
removed triangle indexes
This commit is contained in:
@@ -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)
|
||||||
);
|
);
|
||||||
|
|
||||||

|

|
||||||
@@ -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]
|
|
||||||
);
|
);
|
||||||
|
|
||||||

|

|
||||||
|
@@ -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
|
|
||||||
];
|
|
Reference in New Issue
Block a user