$fn offsets cylinders...?

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

$fn offsets cylinders...?

naviathan
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);  
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);  
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);  
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);  
   
    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);  
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);  
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);  
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);  
}




difference(){
    base();
    mountHoles();
}



--
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: $fn offsets cylinders...?

nophead
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: $fn offsets cylinders...?

naviathan
Ok, I figured out where the issues was. I apologize. I pulled the code from Josef Prusa's Rambo case for the MK2 (I'm just making a plate to adapt the case to 2020 extrusion). His cylinders are set strangely for some reason. Although the hinges and mounts on the case appear square, they must not be.

On Thu, Oct 12, 2017 at 1:12 PM, nop head <[hidden email]> wrote:
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: $fn offsets cylinders...?

nophead
If you are going to 3D print it you probably don't want to set $fn so high on small holes if you want them to come out the right size. See http://hydraraptor.blogspot.co.uk/2011/02/polyholes.html

On 12 October 2017 at 18:18, Jeremy Buseman <[hidden email]> wrote:
Ok, I figured out where the issues was. I apologize. I pulled the code from Josef Prusa's Rambo case for the MK2 (I'm just making a plate to adapt the case to 2020 extrusion). His cylinders are set strangely for some reason. Although the hinges and mounts on the case appear square, they must not be.

On Thu, Oct 12, 2017 at 1:12 PM, nop head <[hidden email]> wrote:
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

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


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



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: $fn offsets cylinders...?

naviathan
Thanks nop head. Nice blog. 

On Oct 12, 2017 13:51, "nop head" <[hidden email]> wrote:
If you are going to 3D print it you probably don't want to set $fn so high on small holes if you want them to come out the right size. See http://hydraraptor.blogspot.co.uk/2011/02/polyholes.html

On 12 October 2017 at 18:18, Jeremy Buseman <[hidden email]> wrote:
Ok, I figured out where the issues was. I apologize. I pulled the code from Josef Prusa's Rambo case for the MK2 (I'm just making a plate to adapt the case to 2020 extrusion). His cylinders are set strangely for some reason. Although the hinges and mounts on the case appear square, they must not be.

On Thu, Oct 12, 2017 at 1:12 PM, nop head <[hidden email]> wrote:
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

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


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



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



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: $fn offsets cylinders...?

RobWLakes
Excellent article! Something about nothing, holes!! Thank you NopHead.

On 13 October 2017 5:13:38 am AEDT, Jeremy Buseman <[hidden email]> wrote:
Thanks nop head. Nice blog. 

On Oct 12, 2017 13:51, "nop head" <[hidden email]> wrote:
If you are going to 3D print it you probably don't want to set $fn so high on small holes if you want them to come out the right size. See http://hydraraptor.blogspot.co.uk/2011/02/polyholes.html

On 12 October 2017 at 18:18, Jeremy Buseman <[hidden email]> wrote:
Ok, I figured out where the issues was. I apologize. I pulled the code from Josef Prusa's Rambo case for the MK2 (I'm just making a plate to adapt the case to 2020 extrusion). His cylinders are set strangely for some reason. Although the hinges and mounts on the case appear square, they must not be.

On Thu, Oct 12, 2017 at 1:12 PM, nop head <[hidden email]> wrote:
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

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


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



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



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


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: $fn offsets cylinders...?

nophead
Thanks.

On 12 October 2017 at 23:04, Rob Ward <[hidden email]> wrote:
Excellent article! Something about nothing, holes!! Thank you NopHead.

On 13 October 2017 5:13:38 am AEDT, Jeremy Buseman <[hidden email]> wrote:
Thanks nop head. Nice blog. 

On Oct 12, 2017 13:51, "nop head" <[hidden email]> wrote:
If you are going to 3D print it you probably don't want to set $fn so high on small holes if you want them to come out the right size. See http://hydraraptor.blogspot.co.uk/2011/02/polyholes.html

On 12 October 2017 at 18:18, Jeremy Buseman <[hidden email]> wrote:
Ok, I figured out where the issues was. I apologize. I pulled the code from Josef Prusa's Rambo case for the MK2 (I'm just making a plate to adapt the case to 2020 extrusion). His cylinders are set strangely for some reason. Although the hinges and mounts on the case appear square, they must not be.

On Thu, Oct 12, 2017 at 1:12 PM, nop head <[hidden email]> wrote:
$fn doesn't affect the position of the hole centre but you want to keep it a multiple of 4 to get symmetrical holes.

On 12 October 2017 at 17:42, naviathan <[hidden email]> wrote:
Code posted below.

Notice when rendered that the holes are not evenly spaced even though the
translates are. I've figured out that if I get rid of the $fn=30 on the
cylinders the holes line up evenly. My understanding is that $fn creates a
more rounded cylinder, but why would it offset them in relation to the
translate coordinates?

module base(){
    cube([168,55,5]);
}

module mountHoles(){
    translate( [ (168 - 16.5) , 3.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , -0.5 ] ) cylinder( h = 5, r = 1.6,
$fn=30);
    translate( [ (168 - 16.5) , 3.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);
    translate( [ (168 - 110.5) , 4.4 , 2.5 ] ) cylinder( h = 3, r = 3,
$fn=30);

    translate( [ (168 - 16.5) , (3.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , -0.5 ] ) cylinder( h = 5, r
= 1.6, $fn=30);
    translate( [ (168 - 16.5) , (3.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r =
3, $fn=30);
    translate( [ (168 - 110.5) , (4.4 + 43.22) , 2.5 ] ) cylinder( h = 3, r
= 3, $fn=30);
}




difference(){
    base();
    mountHoles();
}



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

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


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



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



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


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: $fn offsets cylinders...?

KarijnWessing
In reply to this post by naviathan
You make a module for the base, but not for the mounthole, funny

I would make it like this:

plateHeight = 5;
plateWidth  = 168;
plateLength = 55;

// uncomment next line when defining the mountHole
// mountHole();

difference() {
    base();
    mountHoles();
}


module base() {
    cube([plateWidth,plateLength, plateHeight]);
}

module mountHole() {
    translate( [0 ,0 , 2.5 ] ) cylinder( h=3, r=3, $fn=30);  
    translate( [0 ,0 ,-0.5 ] ) cylinder( h=5, r=1.6, $fn=30);  
}

module mountHoles() {
    // maybe define some constants for 16.5, (110.5 - 16.5), ...
    for(t = [ [(plateWidth - 16.5) , 3.4 , 0],
              [(plateWidth - 110.5) , 4.4, 0],
              [(plateWidth - 16.5) , (3.4 + 43.22), 0],
              [(plateWidth - 110.5) , (4.4 + 43.22), 0]])
       translate(t) mountHole();
}






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

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