OpenSCAD Base Sizing
I am doing some simple tests with PrusaSlicer and OpenSCAD exports. If I make a simple cube, say [20, 20, 1], when I import it into PrusaSlicer, the X and Y are correct, but the Z is 1mm taller than my defined Z. Is there a way to define .scad files to resolve to MM?
RE: OpenSCAD Base Sizing
I've never seen this with OpenScad. All dimensions come across correct. I just tested it, to be sure. Imports fine with 20 x 20 x 1. OpenScad file and 3mf attached.
Maybe I'm missing something...
Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...
RE: OpenSCAD Base Sizing
I've never seen this with OpenScad. All dimensions come across correct. I just tested it, to be sure. Imports fine with 20 x 20 x 1. OpenScad file and 3mf attached.
Maybe I'm missing something...
Looks like I was missing something. It's the use of the minkowski(), when I use it, in the context below, it seems to double the height? Maybe I misunderstand what/how it's working?
RE: OpenSCAD Base Sizing
Ah, minkowski()... a little detail you didn't mention...
Your code definitely creates a square 2 mm in height. Has nothing do to with Prusaslicer -- it's a resulr of the code.
Full disclosure: I use OpenSCAD but I'm not an expert. I would use it more but I found its lack of a true filleting function so frustrating.
And it looks like you're trying to put fillets on your cube. An alternative to minkowski() (which I don't even pretend I understand) is to use this simple filleting module:
module cube_fillet(size, radius){
x = size[0];
y = size[1];
z = size[2];
linear_extrude(height=z)
hull(){
// place 4 circles in the corners, with the given radius
translate([radius, y-radius, 0])
circle(r=radius);
translate([x-radius, radius, 0])
circle(r=radius);
translate([radius, radius, 0])
circle(r=radius);
translate([x-radius, y-radius, 0])
circle(r=radius);
}
}
Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...
RE: OpenSCAD Base Sizing
@lucas
minkowski() adds two shapes in all three dimensions; in your case you are only trying to modify two...
One crude workaround is to minkowski with a cylinder of negligable thickness, h=0.01 adds much less than a printable layer to the object so will not change the final part but this will catch you out eventually.
@fuchsr's method is better in this case. You might find it easier to envisage if you hull() four cylinders of the final height and leave out the extrude.
Cheerio,
RE: OpenSCAD Base Sizing
Appreciate both your help, and the nice thing about OpenSCAD modules as an interface, is I just redid the implementation of what I had, in a better way.
@Diem the nice thing about the Mink was it is in addition to the XY values, as the XY should be the size of the inner part of the container, so I hacked it by duplicating the minkowski and doing a difference to shave off the top.
But I used @Fuchsr's code and did some simple translates if there's a lip size, which definitely makes it a bit more elegant overall.
RE: OpenSCAD Base Sizing
so I hacked it by duplicating the minkowski and doing a difference to shave off the top.
And the bottom?It might be simpler with an intersection.
Cheerio,