1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 21:41:41 +02:00
This commit is contained in:
Justin Lin
2019-09-26 08:17:10 +08:00
parent f9f22d9fc2
commit 0fc52bd023

View File

@@ -21,8 +21,8 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
module square_end(point) { module square_end(point) {
translate(point) translate(point)
rotate(atan_angle) rotate(atan_angle)
square(width, center = true); square(width, center = true);
// hook for testing // hook for testing
test_line2d_cap(point, "CAP_SQUARE"); test_line2d_cap(point, "CAP_SQUARE");
@@ -30,8 +30,8 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
module round_end(point) { module round_end(point) {
translate(point) translate(point)
rotate(atan_angle) rotate(atan_angle)
circle(half_width, $fn = frags); circle(half_width, $fn = frags);
// hook for testing // hook for testing
test_line2d_cap(point, "CAP_ROUND"); test_line2d_cap(point, "CAP_ROUND");
@@ -44,9 +44,9 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
} }
translate(p1) translate(p1)
rotate(atan_angle) rotate(atan_angle)
translate([0, -width / 2]) translate([0, -width / 2])
square([leng, width]); square([leng, width]);
if(p2Style == "CAP_SQUARE") { if(p2Style == "CAP_SQUARE") {
square_end(p2); square_end(p2);