Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minkowski'ed object yields STL as pre-minkowski #1010

Closed
yerazunis opened this issue Nov 7, 2014 · 3 comments
Closed

Minkowski'ed object yields STL as pre-minkowski #1010

yerazunis opened this issue Nov 7, 2014 · 3 comments

Comments

@yerazunis
Copy link

Here's example code that tickles the bug (it's a slide-in handle for a Brompton briefcase)

If you uncomment "preminkowski" and comment out "finalhandle" it outputs the STL correctly. (near the bottom of the code)

If you uncomment "finalhandle" and comment out the preminkowski, you still get the pre-minkowski
in the STL.

Interestingly, the visual image in the right pane is correct in both versions. Only the STL is output
incorrectly.

Version of OpenSCAD is 2014.03 (compiled on the machine I'm using).

  • Bill

// Brompton bag handle.
// This fits in place of the Brompton frame, giving
// a rigid center handle but without the bottom frame.
//
// Design notes: this design starts out as a flat plate, then
// punches out the handle and the bag recesses, and finally rounds
// it all around with a Minkowski (which is slow, but does the job).
//
// Parameters:
oalength = 320;
oaheight = 100;
oathickness = 1;
handholerad = 22;
handholelen = 60;
handholerise = 70;
bagnotchlen = 95;
bagnotchheight = 50;
bagnotchcornerheight = 15;

roundradius = 5;

module init_plate()
{
cube ([oalength, oaheight, oathickness]);
}

module left_notch()
{
translate ([0,oaheight - bagnotchheight, -1])
cube ([bagnotchlen, oaheight, 3*oathickness]);
}

module left_corner ()
{
translate ([bagnotchlen, oaheight-bagnotchcornerheight, -1])
rotate ([0,0,30])
cube ([bagnotchlen, oaheight, 3*oathickness]);
}

module right_notch()
{
translate ([oalength - bagnotchlen, oaheight-bagnotchheight, -1])
cube ([bagnotchlen, oaheight, 3*oathickness]);
}

module right_corner ()
{
translate ([oalength - bagnotchlen, oaheight-bagnotchcornerheight,-1])
rotate ([0,0,-30])
mirror([1,0,0])
cube ([bagnotchlen, oaheight, 3*oathickness]);
}

module handhole()
{
translate ([oalength / 2, handholerise, -1])
hull()
{
translate ([handholelen/2, 0, 0])
cylinder (r = handholerad, h = 3 * oathickness) ;
translate ([-handholelen/2, 0, 0])
cylinder (r = handholerad, h = 3 * oathickness);
}
}

module bottomtaper()
{
$fn = 100;
translate ([oalength/2, oalength*1, -1])
cylinder (r = 1 * oalength, h = 3 * oathickness);
}
module preminkowski ()
{
intersection()
{
bottomtaper();
difference ()
{
init_plate();
left_notch();
left_corner();
right_notch();
right_corner();
handhole();
}
}
}

//preminkowski();

module finalhandle()
{
minkowski()
{
preminkowski();
sphere (r = roundradius);
}
}
finalhandle();

@t-paul
Copy link
Member

t-paul commented Nov 7, 2014

I can't find any problems (changed the $fn=100 to $fn=10 for faster render) loading the exported STLs into meshlab.

Did you use F6 for both exports? Using preview/F5 does not calculate the mesh that is exported. (Note the dev version now gives a warning in that case: #48).

@kintel
Copy link
Member

kintel commented Nov 7, 2014

Btw., I'd recommend using a recent dev version. It's about 15x faster than 2014.03 for this design on my computer.

@yerazunis
Copy link
Author

I cloned down the most recent version of OpenSCAD and the problem is gone. I'll close the bug.

@kintel : you're right; it's also much faster. And prettier. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants