mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-29 01:11:30 +02:00
added test hook
This commit is contained in:
@@ -39,6 +39,9 @@ module line3d(p1, p2, thickness, p1Style = "CAP_CIRCLE", p2Style = "CAP_CIRCLE")
|
|||||||
cap_with(p1)
|
cap_with(p1)
|
||||||
linear_extrude(length)
|
linear_extrude(length)
|
||||||
circle(r, $fn = frags);
|
circle(r, $fn = frags);
|
||||||
|
|
||||||
|
// hook for testing
|
||||||
|
test_line3d_butt(p1, r, frags, length, angles);
|
||||||
}
|
}
|
||||||
|
|
||||||
module cap(p, style) {
|
module cap(p, style) {
|
||||||
@@ -47,10 +50,16 @@ module line3d(p1, p2, thickness, p1Style = "CAP_CIRCLE", p2Style = "CAP_CIRCLE")
|
|||||||
cap_with(p)
|
cap_with(p)
|
||||||
linear_extrude(cap_leng * 2, center = true)
|
linear_extrude(cap_leng * 2, center = true)
|
||||||
circle(r, $fn = frags);
|
circle(r, $fn = frags);
|
||||||
|
|
||||||
|
// hook for testing
|
||||||
|
test_line3d_cap(p, r, frags, cap_leng, angles);
|
||||||
} else if(style == "CAP_SPHERE") {
|
} else if(style == "CAP_SPHERE") {
|
||||||
cap_leng = r / cos(half_fa);
|
cap_leng = r / cos(half_fa);
|
||||||
cap_with(p)
|
cap_with(p)
|
||||||
sphere(cap_leng, $fn = frags);
|
sphere(cap_leng, $fn = frags);
|
||||||
|
|
||||||
|
// hook for testing
|
||||||
|
test_line3d_cap(p, r, frags, cap_leng, angles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,3 +67,12 @@ module line3d(p1, p2, thickness, p1Style = "CAP_CIRCLE", p2Style = "CAP_CIRCLE")
|
|||||||
cap(p1, p1Style);
|
cap(p1, p1Style);
|
||||||
cap(p2, p2Style);
|
cap(p2, p2Style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Override them to test
|
||||||
|
module test_line3d_butt(p, r, frags, length, angles) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module test_line3d_cap(p, r, frags, cap_leng, angles) {
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user