discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

flange

R
roland78
Thu, Oct 18, 2018 6:05 PM

Hi. I need help with this code for a flange-- looks like is empty inside( i
need to be full) and is not totally through the ellipse and holes. Or a
better code for such a flange?

module make_ring_of (radius, count)
{
for (a = [0: count -1])
{
angle = a * 360 /count;

    translate (radius * [sin(angle), -cos(angle), 0])
        rotate ([0, 0, angle])
            children ();
}

}

Thank you.
module oval()
{
scale([2.5,1,1])
circle(10);
}

difference ()
{
cylinder (h=8, r=50);//big flange
{
difference();
cylinder (h=8, r=50);
$fn = 36;// how fine to be the ellipse
translate ([0, 0, 0]);
{offset(r=0.15, h=10)oval();}

        make_ring_of (radius = 30, count = 4)// outside small holes and

how many
cylinder (r = 4, h = 10, centre = true);// dimension of the
outside holes
}
}

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

Hi. I need help with this code for a flange-- looks like is empty inside( i need to be full) and is not totally through the ellipse and holes. Or a better code for such a flange? module make_ring_of (radius, count) { for (a = [0: count -1]) { angle = a * 360 /count; translate (radius * [sin(angle), -cos(angle), 0]) rotate ([0, 0, angle]) children (); } } Thank you. module oval() { scale([2.5,1,1]) circle(10); } difference () { cylinder (h=8, r=50);//big flange { difference(); cylinder (h=8, r=50); $fn = 36;// how fine to be the ellipse translate ([0, 0, 0]); {offset(r=0.15, h=10)oval();} make_ring_of (radius = 30, count = 4)// outside small holes and how many cylinder (r = 4, h = 10, centre = true);// dimension of the outside holes } } -- Sent from: http://forum.openscad.org/
NH
nop head
Thu, Oct 18, 2018 7:54 PM

Is this what you are looking for?

[image: image.png]

There were lots of issues, center spelt wrong for OpenSCAD, translate and
difference with semicolon after them do nothing. Mixing 2D and 3D objects.
Passing h to offset.

On Thu, 18 Oct 2018 at 19:06, roland78 davidroland78@gmail.com wrote:

Hi. I need help with this code for a flange-- looks like is empty inside( i
need to be full) and is not totally through the ellipse and holes. Or a
better code for such a flange?

module make_ring_of (radius, count)
{
for (a = [0: count -1])
{
angle = a * 360 /count;

     translate (radius * [sin(angle), -cos(angle), 0])
         rotate ([0, 0, angle])
             children ();
 }

}

Thank you.
module oval()
{
scale([2.5,1,1])
circle(10);
}

difference ()
{
cylinder (h=8, r=50);//big flange
{
difference();
cylinder (h=8, r=50);
$fn = 36;// how fine to be the ellipse
translate ([0, 0, 0]);
{offset(r=0.15, h=10)oval();}

         make_ring_of (radius = 30, count = 4)// outside small holes and

how many
cylinder (r = 4, h = 10, centre = true);// dimension of the
outside holes
}
}

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


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Is this what you are looking for? [image: image.png] There were lots of issues, center spelt wrong for OpenSCAD, translate and difference with semicolon after them do nothing. Mixing 2D and 3D objects. Passing h to offset. On Thu, 18 Oct 2018 at 19:06, roland78 <davidroland78@gmail.com> wrote: > Hi. I need help with this code for a flange-- looks like is empty inside( i > need to be full) and is not totally through the ellipse and holes. Or a > better code for such a flange? > > module make_ring_of (radius, count) > { > for (a = [0: count -1]) > { > angle = a * 360 /count; > > translate (radius * [sin(angle), -cos(angle), 0]) > rotate ([0, 0, angle]) > children (); > } > } > > Thank you. > module oval() > { > scale([2.5,1,1]) > circle(10); > } > > difference () > { > cylinder (h=8, r=50);//big flange > { > difference(); > cylinder (h=8, r=50); > $fn = 36;// how fine to be the ellipse > translate ([0, 0, 0]); > {offset(r=0.15, h=10)oval();} > > make_ring_of (radius = 30, count = 4)// outside small holes and > how many > cylinder (r = 4, h = 10, centre = true);// dimension of the > outside holes > } > } > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
R
roland78
Fri, Oct 19, 2018 6:24 PM

Yes,nophead.Like yours is what i need.Can i have the code? Thank you.

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

Yes,nophead.Like yours is what i need.Can i have the code? Thank you. -- Sent from: http://forum.openscad.org/
NH
nop head
Fri, Oct 19, 2018 7:56 PM

Yes of course. Here is a slightly simplified version:

module make_ring_of (radius, count)
for (a = [0: count - 1])
rotate(a * 360 /count)
translate ([radius, 0])
children ();

module oval()
scale([2.5, 1])
circle(10);

difference () {
cylinder (h=8, r=50); //big flange
$fn = 36;          // how fine to be the ellipse AND the holes
linear_extrude(height = 17, center = true)
offset(r = 0.15)
oval();

make_ring_of (radius = 30, count = 4)// outside small holes and how many
    cylinder (r = 4, h = 17, center = true);// dimension of the outside

holes
}

Rather than translate to a point on a circle and then rotate the child I
have just translated along the radius and then rotated the translated
child.

I am not sure why you offset the oval. You could just pass the expanded size

On Fri, 19 Oct 2018 at 19:25, roland78 davidroland78@gmail.com wrote:

Yes,nophead.Like yours is what i need.Can i have the code? Thank you.

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


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes of course. Here is a slightly simplified version: module make_ring_of (radius, count) for (a = [0: count - 1]) rotate(a * 360 /count) translate ([radius, 0]) children (); module oval() scale([2.5, 1]) circle(10); difference () { cylinder (h=8, r=50); //big flange $fn = 36; // how fine to be the ellipse AND the holes linear_extrude(height = 17, center = true) offset(r = 0.15) oval(); make_ring_of (radius = 30, count = 4)// outside small holes and how many cylinder (r = 4, h = 17, center = true);// dimension of the outside holes } Rather than translate to a point on a circle and then rotate the child I have just translated along the radius and then rotated the translated child. I am not sure why you offset the oval. You could just pass the expanded size On Fri, 19 Oct 2018 at 19:25, roland78 <davidroland78@gmail.com> wrote: > Yes,nophead.Like yours is what i need.Can i have the code? Thank you. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >