1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-01 21:20:11 +02:00

Fixed use of intersection with conditional argument to suit new OpenSCAD behaviour.

This commit is contained in:
Chris Palmer
2020-10-03 15:53:41 +01:00
parent 933fea687c
commit e39af154bb
3 changed files with 29 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

View File

@@ -137,19 +137,26 @@ module insert_lug(insert, wall, counter_bore = 0, extension = 0, corner_r = 0, f
boss_h = insert_hole_length(insert); boss_h = insert_hole_length(insert);
boss_h2 = boss_h + counter_bore; boss_h2 = boss_h + counter_bore;
module shape() module shape() {
intersection() { module _shape()
hull() { hull() {
circle(boss_r); circle(boss_r);
translate([boss_r + extension - eps, 0]) translate([boss_r + extension - eps, 0])
square([eps, 2 * boss_r], center = true); square([eps, 2 * boss_r], center = true);
} }
if(corner_r)
if(corner_r)
intersection() {
_shape();
translate([boss_r + extension - corner_r, 0]) translate([boss_r + extension - corner_r, 0])
rotate(-45) rotate(-45)
quadrant(w = 100, r = corner_r - eps, center = true); quadrant(w = 100, r = corner_r - eps, center = true);
} }
else
_shape();
}
translate_z(-boss_h) translate_z(-boss_h)
linear_extrude(boss_h) linear_extrude(boss_h)

View File

@@ -179,23 +179,27 @@ module jhead_hot_end_assembly(type, filament, naked = false) { //! Assembly with
// //
// heater block // heater block
// //
rotate(90) module heater_components() {
translate([-nozzle_x(heater), 0, inset - insulator_length - heater_height(heater) / 2]) { translate([resistor_x(heater), -exploded() * 15, 0])
intersection() { rotate([90, 0, 0])
group() { sleeved_resistor(resistor, PTFE20, bare = -10);
translate([resistor_x(heater), -exploded() * 15, 0])
rotate([90, 0, 0]) translate([-heater_length(heater) / 2 + resistor_length(thermistor) / 2 - exploded() * 10, thermistor_y(heater), 0])
sleeved_resistor(resistor, PTFE20, bare = -10); rotate([90, 0, -90])
sleeved_resistor(thermistor, PTFE07, heatshrink = HSHRNK16);
}
rotate(90)
translate([-nozzle_x(heater), 0, inset - insulator_length - heater_height(heater) / 2])
if(exploded())
heater_components();
else
intersection() {
heater_components();
translate([-heater_length(heater) / 2 + resistor_length(thermistor) / 2 - exploded() * 10, thermistor_y(heater), 0])
rotate([90, 0, -90])
sleeved_resistor(thermistor, PTFE07, heatshrink = HSHRNK16);
}
if(!exploded())
if(naked) if(naked)
color("grey") cylinder(r = 12, h = 100, center = true); color("grey") cylinder(r = 12, h = 100, center = true);
else else
cube(1, true); // hide the wires when not exploded cube(1, true); // hide the wires when not exploded
} }
}
} }