# Split .stl using difference??

6 messages
Open this post in threaded view
|

## Split .stl using difference??

Open this post in threaded view
|

## Re: Split .stl using difference??

 Try adding  ‘,convexity=10' to the imports (and you can loose a lot of the braces)On 6 Mar 2021, at 16:48, Chris Johnson via Discuss <[hidden email]> wrote:intersection(){union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");translate([41.5,0,0]){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");}}union(){translate([40,68,60]){    color("green",0.5){        cube ([44,120,140], center = true);    }}translate([-39,68,60]){    color("green",0.5){        cube ([40,120,140], center = true);    }}translate([.5,52.5,61]){    color("blue",0.5){        cube ([40.5,120,140], center = true);    }}translate([81,52.5,61]){    color("blue",0.5){        cube ([40.5,120,140], center = true);    }}translate([-2,-12,-20]){    color("red",0.5){        cylinder(30,10,10);    }}translate([40,3,-20]){    color("red",0.5){        cylinder(30,10,10);    }}}}_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Split .stl using difference??

 On 3/6/2021 9:29 AM, Bob Carter wrote: Try adding  ‘,convexity=10' to the imports (and you can loose a lot of the braces) Yes, convexity is the problem here. Indeed, many of the braces are unnecessary, but always always always indent.  If you're inside braces, indent. For instance, for this segment: ```intersection(){ union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); translate([41.5,0,0]){ import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); } } ... ``` indent it like so: ```intersection() { union() { import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); translate([41.5,0,0]) { import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); } } ... ``` Use the indentation to show the structure; don't make the reader match up the braces. Any particular reason that you're constructing your own dual dock by unioning two single docks, instead of using the dual dock provided?  Not that it matters to this question. Strangely, the first time that I previewed this model, the intersection ... didn't.  It showed the original docks and the cubes for the intersection, and the intersection acted like a union.  Subsequent previews, including after restarting, got it right.  (Give or take the convexity issue.)  This is on 2021.01 on Windows. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|