mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
fixed end precision
This commit is contained in:
@@ -27,6 +27,13 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
|
||||
p2 + offset2, p1 + offset2
|
||||
]);
|
||||
|
||||
frags = $fn > 0 ?
|
||||
($fn >= 3 ? $fn : 3) :
|
||||
max(min(360 / $fa, half_width * 2 * 3.14159 / $fs), 5);
|
||||
|
||||
remain = frags % 4;
|
||||
end_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain;
|
||||
|
||||
module square_end(point) {
|
||||
translate(point)
|
||||
rotate(atan_angle)
|
||||
@@ -35,7 +42,8 @@ module line2d(p1, p2, width, p1Style = "CAP_SQUARE", p2Style = "CAP_SQUARE") {
|
||||
|
||||
module round_end(point) {
|
||||
translate(point)
|
||||
circle(half_width, center = true);
|
||||
rotate(atan_angle)
|
||||
circle(half_width, center = true, $fn = end_frags);
|
||||
}
|
||||
|
||||
if(p1Style == "CAP_SQUARE") {
|
||||
|
Reference in New Issue
Block a user