Welcome! Log In Create A New Profile

Advanced

openscad question

Posted by chris33 
openscad question
April 05, 2013 04:34PM
how do get the nema 17 to render in this script ty new learner cheers stepper motors scad
Re: openscad question
April 05, 2013 05:05PM
You need to call the NEMA module from somewhere, this script is intended to be called from elsewhere so it lacks an entry point into the code - run on its own, theres no first line to start executing. You can add one simply enough?

NEMA(NEMA17);

You would normally do this from another file that includes this file. NEMA17 can be replaced with any of the motors listed in the table near the start of the file.
Re: openscad question
April 05, 2013 05:37PM
cheers that helped thankyou
Re: openscad question
April 05, 2013 06:16PM
teaching myself this so please excuse the dumbness can anyone look at the following script

module nema17_holes() {
union(){
cube ([42.2,10,42.2]);
translate ([5.58,0,5.58])rotate ([90,0,0])cylinder ( r=1.6, h=5, $fn=30);
translate ([36.42,0,5.58])rotate ([90,0,0])cylinder ( r=1.6, h=5, $fn=30);
translate ([36.42,0,36.42])rotate ([90,0,0])cylinder ( r=1.6, h=5, $fn=30);
translate ([5.58,0,36.42])rotate ([90,0,0])cylinder ( r=1.6, h=5, $fn=30);
}}

difference()
{
translate ([0,-3,0])cube ([44.2,6,44.2]);
nema17_holes();

}

i know that its messy and the probably shorter code i could use to get the effect i am after, but this is a learning curve. i am trying to make a nema 17 stepper mount as practice as i can use it to the similar design as the wades geared extruder so i thought id have a practice on the motor mount abit just to get my head around things.

Now i thought i done well with the above script but the holes have a line in the middle of them and should not as they have been subtracted what have i done wrong?
Re: openscad question
April 05, 2013 06:32PM
The cylinders should extend beyond the solid they are being subtracted from, you have the top face of them exactly level with the top of the cube.
Re: openscad question
April 06, 2013 08:59PM
i sussed it i think this script gave me what i wanted to achieve


module nema17_holes() {
union(){
cube ([42.2,10,42.2]);
translate ([5.58,1,5.58])rotate ([90,0,0])cylinder ( r=1.6, h=12, $fn=30);
translate ([36.42,1,5.58])rotate ([90,0,0])cylinder ( r=1.6, h=12, $fn=30);
translate ([36.42,1,36.42])rotate ([90,0,0])cylinder ( r=1.6, h=12, $fn=30);
translate ([5.58,1,36.42])rotate ([90,0,0])cylinder ( r=1.6, h=12, $fn=30);
}}

difference()
{
cube ([44.2,10,44.2]) ;
translate ([0,2,0]) nema17_holes();


just posting it to check difference to figure where i went wrong 1st time
Sorry, only registered users may post in this forum.

Click here to login