How to combine difference with concatinate object

1

The following creates an object with two slots:

 translate([-40,-40,0]) difference() {
     cube ([90,28,12]);
     translate([12,-.01,5]) cube([12.7,28.02,14.02]);
     translate([65,-.01,5]) cube([12.7,28.02,14.02]);

How can the first main cube be extended to be a complex object of the syntax:

cube([60,20,10],center=true);translate([0,0,5])cube([30,20,10],center=true);

and then use difference to create holes?

dan sawyer

Posted 2021-01-15T16:23:02.720

Reputation: 31

Question was closed 2021-01-15T22:52:11.477

1I fail to see why this question "does not appear to be about tools and applications of 3D printing", since it is about the use of a popular 3D CAD package. Voting to re-open. – Mick – 2021-01-16T10:09:42.653

2@Mick CAD is only so far on topic as it solves a printing problem. You need to show how this operation you try is related to 3D printing - for example "cutting up" to print in parts. for "remove one part" you'd have to point out why this is not a simple CAD question but related to 3D printing, for example by telling something like "I want to print with 2 materials in my MMU. I have a model and want to put color A in most but color B in the cutout." – Trish – 2021-01-16T13:53:48.487

1

Both Mick and Trish raise very valid points. Dan, if you can edit your question to make it more applicable to 3D Printing then the question could be re-opened, otherwise we fear than we may become a "non-3D Printing related CAD" support site, if you see what I mean. See our on-topic page and CAD Questions - Review. Hi and welcome to SE.3DP, btw! :-)

– Greenonline – 2021-01-16T15:30:46.370

Answers

2

The union syntax addresses this:

translate([-40,-40,0]) 
difference() {
    union() {
        cube ([90,28,12]);

        translate([20,0,20]) 
        cube([12,12,12]);
    }

    translate([12,-.01,5]) 
    cube([12.7,28.02,14.02]);

    translate([65,-.01,5]) 
    cube([12.7,28.02,14.02]); 
}

It supports creating an object before the difference syntax is applied.

dan sawyer

Posted 2021-01-15T16:23:02.720

Reputation: 31