mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 05:52:16 +02:00
use joint_T to refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
include <line2d.scad>;
|
include <line2d.scad>;
|
||||||
include <hollow_out.scad>;
|
include <hollow_out.scad>;
|
||||||
include <box_extrude.scad>;
|
include <box_extrude.scad>;
|
||||||
|
include <part/joint_T.scad>;
|
||||||
include <triangle2square.scad>;
|
include <triangle2square.scad>;
|
||||||
|
|
||||||
tri_side_leng = 100;
|
tri_side_leng = 100;
|
||||||
@@ -14,28 +15,7 @@ module triangle2square_box(type, tri_side_leng, height, spacing, ring_width, sha
|
|||||||
half_h = height / 2;
|
half_h = height / 2;
|
||||||
|
|
||||||
joint_ring_inner = shaft_r + spacing;
|
joint_ring_inner = shaft_r + spacing;
|
||||||
joint_ring_outer = joint_ring_inner + ring_width;
|
joint_r_outermost = joint_ring_inner + ring_width + spacing;
|
||||||
joint_r_outermost = joint_ring_outer + spacing;
|
|
||||||
|
|
||||||
module joint() {
|
|
||||||
module joint_ring() {
|
|
||||||
hollow_out(ring_width)
|
|
||||||
circle(joint_ring_outer);
|
|
||||||
}
|
|
||||||
|
|
||||||
ring_height = height / 3 - spacing;
|
|
||||||
linear_extrude(ring_height) joint_ring();
|
|
||||||
translate([0, 0, height - ring_height])
|
|
||||||
linear_extrude(ring_height) joint_ring();
|
|
||||||
|
|
||||||
translate([0, 0, half_h])
|
|
||||||
linear_extrude(height / 3, center = true)
|
|
||||||
line2d([0, 0], [joint_r_outermost, 0], shaft_r * 2, p1Style = "CAP_BUTT", p2Style = "CAP_BUTT");
|
|
||||||
|
|
||||||
// pillar
|
|
||||||
linear_extrude(height) circle(shaft_r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
offsetd = -spacing / 2;
|
offsetd = -spacing / 2;
|
||||||
tri_sq = triangle2square(tri_side_leng);
|
tri_sq = triangle2square(tri_side_leng);
|
||||||
@@ -67,9 +47,9 @@ module triangle2square_box(type, tri_side_leng, height, spacing, ring_width, sha
|
|||||||
box_extrude(height = height, shell_thickness = ring_width)
|
box_extrude(height = height, shell_thickness = ring_width)
|
||||||
2d_tri_square();
|
2d_tri_square();
|
||||||
|
|
||||||
translate(tri_sq[1][0]) rotate(65) joint();
|
translate(tri_sq[1][0]) rotate(65) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
translate(tri_sq[1][1]) rotate(170) joint();
|
translate(tri_sq[1][1]) rotate(170) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
translate(tri_sq[1][2]) rotate(275) joint();
|
translate(tri_sq[1][2]) rotate(275) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
}
|
}
|
||||||
else if(type == "COVER") {
|
else if(type == "COVER") {
|
||||||
box_extrude(height = ring_width * 2, shell_thickness = ring_width)
|
box_extrude(height = ring_width * 2, shell_thickness = ring_width)
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
include <line2d.scad>;
|
include <line2d.scad>;
|
||||||
include <hollow_out.scad>;
|
include <hollow_out.scad>;
|
||||||
|
include <part/joint_T.scad>;
|
||||||
include <triangle2square.scad>;
|
include <triangle2square.scad>;
|
||||||
|
|
||||||
tri_side_leng = 45;
|
tri_side_leng = 45;
|
||||||
@@ -16,28 +17,7 @@ module triangle2square_pendant(tri_side_leng, height, spacing, ring_width, shaft
|
|||||||
half_h = height / 2;
|
half_h = height / 2;
|
||||||
|
|
||||||
joint_ring_inner = shaft_r + spacing;
|
joint_ring_inner = shaft_r + spacing;
|
||||||
joint_ring_outer = joint_ring_inner + ring_width;
|
joint_r_outermost = joint_ring_inner + ring_width + spacing;
|
||||||
joint_r_outermost = joint_ring_outer + spacing;
|
|
||||||
|
|
||||||
module joint() {
|
|
||||||
module joint_ring() {
|
|
||||||
hollow_out(ring_width)
|
|
||||||
circle(joint_ring_outer);
|
|
||||||
}
|
|
||||||
|
|
||||||
ring_height = height / 3 - spacing;
|
|
||||||
linear_extrude(ring_height) joint_ring();
|
|
||||||
translate([0, 0, height - ring_height])
|
|
||||||
linear_extrude(ring_height) joint_ring();
|
|
||||||
|
|
||||||
translate([0, 0, half_h])
|
|
||||||
linear_extrude(height / 3, center = true)
|
|
||||||
line2d([0, 0], [joint_r_outermost, 0], shaft_r * 2, p1Style = "CAP_BUTT", p2Style = "CAP_BUTT");
|
|
||||||
|
|
||||||
// pillar
|
|
||||||
linear_extrude(height) circle(shaft_r);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
offsetd = -spacing / 2;
|
offsetd = -spacing / 2;
|
||||||
tri_sq = triangle2square(tri_side_leng);
|
tri_sq = triangle2square(tri_side_leng);
|
||||||
@@ -65,9 +45,9 @@ module triangle2square_pendant(tri_side_leng, height, spacing, ring_width, shaft
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
translate(tri_sq[1][0]) rotate(65) joint();
|
translate(tri_sq[1][0]) rotate(65) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
translate(tri_sq[1][1]) rotate(170) joint();
|
translate(tri_sq[1][1]) rotate(170) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
translate(tri_sq[1][2]) rotate(275) joint();
|
translate(tri_sq[1][2]) rotate(275) joint_T(shaft_r, height, joint_r_outermost, ring_width, spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user