On 04/02/2022 12:53, Carsten Fuchs wrote:
Am 04.02.22 um 13:31 schrieb Raymond West:
However, it is quite interesting. Maybe a more complicated example
would help me understand what I may be missing.
Please consider this example that I posted elsewhere in this thread:
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
module panel() {
cube([100, 100, 2], center=true);
}
union() {
#panel();
// Module case() created an empty box, but when sunk into the panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting cube(26) also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
Even though a trivial example, it seems to be very complicated to
clear the inside of the box.
Best regards,
Carsten
Hi,
If this is the result you want for your example (a square hole) then I
do not understand how you could expect that (see my comments in the
modified code below). The expectation, imnsho, needs a concise
definition, as I mentioned, exactly like the requests for measuring. It
then becomes cumbersome to apply. How about if the case is on it's side,
say.? The hole is the boundary of the outside edge of the case where it
contacts the panel, I n every situation, I would think.
On 04/02/2022 12:53, Carsten Fuchs wrote:
Am 04.02.22 um 13:31 schrieb Raymond West:
However, it is quite interesting. Maybe a more complicated example
would help me understand what I may be missing.
Please consider this example that I posted elsewhere in this thread:
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
module panel() {
cube([100, 100, 2], center=true);
}
union() {
#panel();
// Module case() created an empty box, but when sunk into the
panel
// the panel is also inside the box.
// Thus, desired is a method that subtracts the cutting
cube(26) also
// in the scope of this union (but not necessarily further up!).
rotate([10, -12, 0])
translate([0, 0, -20])
case();
}
Even though a trivial example, it seems to be very complicated to
clear the inside of the box.
Best regards,
Carsten
Hi,
If this is the result you want for your example (a square hole) then I
do not understand how you could expect that (see my comments in the
modified code below). The expectation, imnsho, needs a concise
definition, as I mentioned, exactly like the requests for measuring. It
then becomes cumbersome to apply. How about if the case is on it's side,
say.? The hole is the boundary of the outside edge of the case where it
contacts the panel, I would think. If there is a problem with the 'z
fighting' at the interface, then do exctly what would done in pactice
when fitting a solid into a panel, whatever, add some clearance.
module outside(){
cube(30);
}
module inside(){
translate([2, 2, 4.1])
cube(26);
}
module case(){
difference(){
outside();
inside();
}}
/*
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
*/
module panel() {
cube([100, 100, 2], center=true);
}
difference() {
#panel();
// the outside module also defines the size/shape of the panel hole
// if I drive a tube through a panel, I would expect the panel to
be inside the tube
// you are not saying if you are pushing the case from below the
panel, or above.
// your example would show it if pushed from below, mine as if it is
pushed from above.
// Which one is correct??? How to define the direction?
// another view, adding a hole is the same as subtracting a solid,
or is it?
// I would not expect it to work any differently than you or I have
shown.
rotate([10, -12, 0])
translate([0, 0, -20])
outside();
}
guess.
module outside(){
cube(30);
}
module inside(){
translate([2, 2, 4.1])
cube(26);
}
module case(){
difference(){
outside();
inside();
}}
/*
module case() {
difference() {
cube(30);
// Make the box empty.
translate([2, 2, 4.1])
cube(26);
}
}
*/
module panel() {
cube([100, 100, 2], center=true);
}
difference() {
#panel();
// the outside module also defines the size/shape of the panel hole
// if I drive a tube through a panel, I would expect the panel to
be inside the tube
// you are not saying if you are pushing the case from below the
panel, or above.
// your example would show it if pushed from below, mine as if it is
pushed from above.
// Which one is correct??? How to define the direction?
// another view, adding a hole is the same as subtracting a solid,
or is it?
// I would not expect it to work any differently than you or I have
shown.
rotate([10, -12, 0])
translate([0, 0, -20])
outside();
}
Am 04.02.22 um 22:31 schrieb Raymond West:
// the outside module also defines the size/shape of the panel hole
Sorry, but no. The inside, that is, the part that is subtracted to clear the inside of the box, is expected to also clear the hole in the panel.
// if I drive a tube through a panel, I would expect the panel to be inside the tube
// you are not saying if you are pushing the case from below the panel, or above.
This doesn't seem to make a difference?
Please see the message by Jordan Brown, he came up with an even better example than I did (intersecting pipes).
Best regards,
Carsten