Stackup problem with small parts?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Stackup problem with small parts?

KM6VV
I've got a small part, an eccentric.  0.375" thick.

I multiply each parameter by 25.4 to get into metric units.

It consists of these layers:

EccentricSheeveThick = 0.078125
EccentricSheeveThick = 0.078125
EccentricGrooveThick = 0.0625
BossLength           = 0.15625

Which when stacked, should equal the total length (the eccentric thickness).
EccentricThick       = 0.375  total

But in the SCAD file, the center cylinder (bore) is taller then the stack up
of the 4 parts, seen on the rendered graphic.

A DXF exported to and then scaled back to inches ( scale 1/25.4) shows each
of the layers as being shorter then specified.  

Stackup?  Or hopefully did I make an error?

Thanks for looking.




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

MichaelAtOz
Administrator
Sharing the source code will help.



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

KM6VV
Sure,

Here's the source code for eccentric:


/*
 * Horizontal Steam Engine eccentric  
 *
 * eccentric
 *
 * 03/23/2018 alm
 */

scale = 25.4; // for imperial
$fn = 100;

EccentricSheaveDia = 0.625 * scale;
EccentricSheeveThick = 0.078125 * scale;

EccentricGrooveDia = 0.500 * scale;
EccentricGrooveThick = 0.0625 * scale;

EccentricOffset = 0.09375 * scale;
EccentricBore = 0.28125 * scale;
BossDia = 0.4375 * scale;
BossLength = 0.15625 * scale;

EccentricBossSetscrew = 0.089 * scale;
EccentricSetScrewLen = 0.375 * scale;
EccentricSetScrewOffset = (BossLength + EccentricSheeveThick) / 2.0 * scale;

EccentricThick = 0.375 * scale;

//projection(cut = true)  // project X - Y plane for creating DXF
//  rotate([0, 90, 0])   // flip over if needed

    Eccentric();  // top level function
   
//  ========================================================
module Eccentric()
    {
    translate([0, 0, EccentricSheeveThick / 2.0])  // get 1st sheave bottom
on XY plane to simplify calcs
      {    
      difference()
        {
         union()
           {
        /* Sheeve */
         translate([EccentricOffset, 0, 0])  
           linear_extrude(height = EccentricSheeveThick + 0.2, center =
true)    
             circle(d = EccentricSheaveDia, center = true);
     
        /* Groove */
         translate([EccentricOffset, 0, EccentricSheeveThick])  
           linear_extrude(height = EccentricGrooveThick + 0.1, center =
true)    
             circle(d = EccentricGrooveDia, center = true);
     
        /* Sheeve */
         translate([EccentricOffset, 0, EccentricSheeveThick +
EccentricGrooveThick])  
           linear_extrude(height = EccentricSheeveThick + 0.1, center =
true)    
             circle(d = EccentricSheaveDia, center = true);
       
        /* boss */
         translate([0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick ])  
           linear_extrude(height = BossLength, center = true)    
             circle(d = BossDia, center = true);
               
//        /* Bore .. goes below as a diff */
//       translate([0, 0, (EccentricThick / 2.0) - (EccentricSheeveThick /
2.0) -.1 ])
//         linear_extrude(height = EccentricThick + .2, center = true)
//           circle(d = EccentricBore, center = true);
           }    
         
                /* set screw   goest here!  */
       translate([BossDia / 2.0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick + (BossLength / 2.0) ] )
         rotate([0, 90, 0])
           linear_extrude(height = EccentricSetScrewLen, center = true)
             circle(d = EccentricBossSetscrew, center = true);
       
       
//        /* Bore   goes here!  */
//       translate([0, 0, (EccentricThick / 2.0) - (EccentricSheeveThick /
2.0) -.1 ])
//         linear_extrude(height = EccentricThick - .1, center = true)
//           circle(d = EccentricBore, center = true);
      }  
   }
                        /* put in as solid to check */
        /* Bore */
       translate([0, 0, (EccentricThick / 2.0) -.1 ])
         linear_extrude(height = EccentricThick + .2, center = true)
           circle(d = EccentricBore, center = true);
   
  }

//  ========================================================

THANKS!



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

MichaelAtOz
Administrator
Is it the extra 0.2 from:
linear_extrude(height = EccentricThick + .2, center = true)
?



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

MichaelAtOz
Administrator
No, sorry...



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

MichaelAtOz
Administrator
It is all the center=true in the linear_extrude() in the union().
Change them to false, and remove the z translate at the top and it works.
Use "%" at the front of each linear_extrude() to clearly see where each
layer is ATM.



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

KM6VV
This post was updated on .
Thanks, I just tried it!

I re-built and exported a DXF to my CAD program, and in the boss dia and
overall length, I'm spot-on.  A little off on the small thicknesses, 'tho,
and they stack up OK as far as I can see.  The errors are
probably down in the 'noise' of the actual 3D printing, I'm guessing.  

Simpler without the 'true's in the various linear_extrudes anyway.  So why
the errors?  I'd have thought it would have worked anyway.  Is this unique?
I've been using the 'center' quite a bit in my other engine parts.  (I've
yet to print, waiting on a 3D printer) and in most cases, 'center'
simplifies things.  I should check a few parts with a DXF...

What is the internal precision for OpenSCAD?  doubles or long doubles?
What's a reasonable limit to the resolution I should expect?  

Thanks again!

<http://forum.openscad.org/file/t2193/EngineAssembly2.png



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

MichaelAtOz
Administrator
KM6VV wrote
>  So why
> the errors?  

As you were adding a smidgeon to their height, the center=true dropped their
starting Z position by smidgeon/2, you were not taking that into account
when you placed the next object.

Try this to see (the "%" operator is your friend):

module Eccentric()
    {
    translate([0, 0, 0]) // EccentricSheeveThick / 2.0])  // get 1st sheave
bottom on XY plane to simplify calcs
      {    
      difference()
        {
         union()
           {
        /* Sheeve */
         translate([EccentricOffset, 0, 0])  
           linear_extrude(height = EccentricSheeveThick + 0.2, center =
true)    
             circle(d = EccentricSheaveDia, center = true);
     
        /* Groove */
         translate([EccentricOffset, 0, EccentricSheeveThick])  
           linear_extrude(height = EccentricGrooveThick + 0.1, center =
true)    
             circle(d = EccentricGrooveDia, center = true);
     
        /* Sheeve */
         %translate([EccentricOffset, 0, EccentricSheeveThick +
EccentricGrooveThick])  
           linear_extrude(height = EccentricSheeveThick + 0.1, center =
true)    
             circle(d = EccentricSheaveDia, center = true);
       
        /* boss */
         translate([0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick ])  
           linear_extrude(height = BossLength, center = true)    
             circle(d = BossDia, center = true);
           }    
                /* set screw   goest here!  */
       translate([BossDia / 2.0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick + (BossLength / 2.0) ] )
         rotate([0, 90, 0])
           linear_extrude(height = EccentricSetScrewLen, center = true)
             circle(d = EccentricBossSetscrew, center = true);
      }  
   }
                        /* put in as solid to check */
        /* Bore */
       translate([0, 0, (EccentricThick / 2.0)  ])
         linear_extrude(height = EccentricThick, center = true)
           circle(d = EccentricBore, center = true);
   
  }



> What is the internal precision for OpenSCAD?  doubles or long doubles?
> What's a reasonable limit to the resolution I should expect?  

See  the wiki
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Values_and_Data_Types>
.
Generally resolution, in itself, is not an issue.
There is a current known problem with tiny numbers, e.g. if your whole space
is < ~10 and using fine details (e.g. 0.02), if you see strange things in
such cases, multiply all you numbers by, say, 1000, then scale the final
result down by 1000.



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Stackup problem with small parts?

KM6VV


I see it:

        /* boss */
         translate([0, 0, (EccentricSheeveThick * 2.5) +

I had 2.0, so I was a half a sheeve (sheave) off.  

I did take out the 'true's in the linear_extrudes, and it looks better
(simpler!):

module Eccentric()
    {
      difference()
        {
         union()
           {
        /* Sheeve */
         translate([EccentricOffset, 0, 0])  
           linear_extrude(height = EccentricSheeveThick + 0.2, center =
false)    
             circle(d = EccentricSheaveDia, center = true);
     
        /* Groove */
         translate([EccentricOffset, 0, EccentricSheeveThick])  
           linear_extrude(height = EccentricGrooveThick + 0.1, center =
false)    
             circle(d = EccentricGrooveDia, center = true);
     
        /* Sheeve */
         translate([EccentricOffset, 0, EccentricSheeveThick +
EccentricGrooveThick])  
           linear_extrude(height = EccentricSheeveThick + 0.1, center =
false)    
             circle(d = EccentricSheaveDia, center = true);
       
        /* boss */
         translate([0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick ])  
           linear_extrude(height = BossLength, center = false)    
             circle(d = BossDia, center = true);
           }    
         
        /* Bore   goes here!  */
       translate([0, 0, -.1 ])
         linear_extrude(height = EccentricThick + .2, center = false)
           circle(d = EccentricBore, center = true);

       /* set screw   goes here!  */
        translate([BossDia / 2.0, 0, (EccentricSheeveThick * 2.0) +
EccentricGrooveThick + (BossLength / 2.0) ] )
         rotate([0, 90, 0])
           linear_extrude(height = EccentricSetScrewLen, center = true)
             circle(d = EccentricBossSetscrew, center = true);
      }
  }

Thanks for the link, I'll study it.  I had kicked up my 'scale' to 254, but
didn't notice a difference.  I'll keep it in mind.  I have a small 'slide
valve' to model.

I really enjoy modeling parts with OpenSCAD!  A terrific tool, especially
for a 'C' programmer with a little graphics!

Thanks!

<http://forum.openscad.org/file/t2193/Eccentric.png>





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org