discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Using bevel library / what is a connector?

V
vIQleS
Thu, Dec 10, 2015 2:28 AM

Can anyone help me understand this pls? Still a noob, so I'm making no
headway with the "instructions"...

I'm trying to do an indent ala:
https://www.tinkercad.com/things/0Bsnpi3wsOY-copy-of-tray-for-penny-press-board-game-stacks-of-stories

I thought I might be able to do it with the bevel library that I found:
http://www.thingiverse.com/thing:30336

But I have no idea what a coordinate is or how it fits in / is used here...
It seems to be an array of arrays. The comments from the library are at the
bottom of the code.

Code is copied and pasted from one of the examples and I've tried to change
it to suit...

Code:

use <obiscad/bevel.scad>
use <obiscad/attach.scad>

//-- Parts parameters
th = 3;
bsize = 1;
size = [bsize,60,th];
rad=10;

//-- The two ortogonal parts
translate([rad*2,0,0])
cube(size,center=true);

cylinder(th,rad,rad, $fn=100, center=true);

//-- Define the connectors
ec = [ [0,rad,0], [0,0,0], 0];
en = [ [0,rad,0], [rad*2+bsize/2,rad,0],  0];

//-- Debuging
*connector(ec3);
*connector(en3);

//-- 1 bigger rounded buttress
bconcave_corner_attach(ec,en,th,cr=8,cres=100, l=th);

//[crn, ?, ?]

//---------------------------------------------------------------------------
//-- API MODULE
//--
//--  Attach a Beveled concave corner
//--  Two connectors are needed:
//--    * edge_c  : Connector located on the edge, paralell to the edge
//--    * normal_c : Connector located on the same point than edge_c
//--                pointing to the internal corner part, in the direction
//--                of the corner bisector
//--    * cr        : Corner radius
//--    * cres      : Corner resolution
//--    * l        : Corner length
//--    * th        : Corner thickness (not visible when ext_corner=false)
//--    * ext_corner: If the exterior corner is used as a reference
//--------------------------------------------------------------------------

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Can anyone help me understand this pls? Still a noob, so I'm making no headway with the "instructions"... I'm trying to do an indent ala: https://www.tinkercad.com/things/0Bsnpi3wsOY-copy-of-tray-for-penny-press-board-game-stacks-of-stories I thought I might be able to do it with the bevel library that I found: http://www.thingiverse.com/thing:30336 But I have no idea what a coordinate is or how it fits in / is used here... It seems to be an array of arrays. The comments from the library are at the bottom of the code. Code is copied and pasted from one of the examples and I've tried to change it to suit... Code: use <obiscad/bevel.scad> use <obiscad/attach.scad> //-- Parts parameters th = 3; bsize = 1; size = [bsize,60,th]; rad=10; //-- The two ortogonal parts translate([rad*2,0,0]) cube(size,center=true); cylinder(th,rad,rad, $fn=100, center=true); //-- Define the connectors ec = [ [0,rad,0], [0,0,0], 0]; en = [ [0,rad,0], [rad*2+bsize/2,rad,0], 0]; //-- Debuging *connector(ec3); *connector(en3); //-- 1 bigger rounded buttress bconcave_corner_attach(ec,en,th,cr=8,cres=100, l=th); //[crn, ?, ?] //--------------------------------------------------------------------------- //-- API MODULE //-- //-- Attach a Beveled concave corner //-- Two connectors are needed: //-- * edge_c : Connector located on the edge, paralell to the edge //-- * normal_c : Connector located on the same point than edge_c //-- pointing to the internal corner part, in the direction //-- of the corner bisector //-- * cr : Corner radius //-- * cres : Corner resolution //-- * l : Corner length //-- * th : Corner thickness (not visible when ext_corner=false) //-- * ext_corner: If the exterior corner is used as a reference //-------------------------------------------------------------------------- -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JD
Jerry Davis
Thu, Dec 10, 2015 4:57 AM

your first link does not exist.
can you provide an image of it?

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

I
*f you give someone a program, you will frustrate them for a day; if you
teach them how to program, you will frustrate them for a lifetime. *-
Anonymous

If writing good code requires very little comments, then writing really
excellent code requires no comments at all!
- Ken Thompson

On Wed, Dec 9, 2015 at 7:28 PM, vIQleS nathan@lx1.co.nz wrote:

Can anyone help me understand this pls? Still a noob, so I'm making no
headway with the "instructions"...

I'm trying to do an indent ala:

https://www.tinkercad.com/things/0Bsnpi3wsOY-copy-of-tray-for-penny-press-board-game-stacks-of-stories

I thought I might be able to do it with the bevel library that I found:
http://www.thingiverse.com/thing:30336

But I have no idea what a coordinate is or how it fits in / is used here...
It seems to be an array of arrays. The comments from the library are at the
bottom of the code.

Code is copied and pasted from one of the examples and I've tried to change
it to suit...

Code:

use <obiscad/bevel.scad>
use <obiscad/attach.scad>

//-- Parts parameters
th = 3;
bsize = 1;
size = [bsize,60,th];
rad=10;

//-- The two ortogonal parts
translate([rad*2,0,0])
cube(size,center=true);

cylinder(th,rad,rad, $fn=100, center=true);

//-- Define the connectors
ec = [ [0,rad,0], [0,0,0], 0];
en = [ [0,rad,0], [rad*2+bsize/2,rad,0],  0];

//-- Debuging
*connector(ec3);
*connector(en3);

//-- 1 bigger rounded buttress
bconcave_corner_attach(ec,en,th,cr=8,cres=100, l=th);

//[crn, ?, ?]

//---------------------------------------------------------------------------
//-- API MODULE
//--
//--  Attach a Beveled concave corner
//--  Two connectors are needed:
//--    * edge_c  : Connector located on the edge, paralell to the edge
//--    * normal_c : Connector located on the same point than edge_c
//--                pointing to the internal corner part, in the direction
//--                of the corner bisector
//--    * cr        : Corner radius
//--    * cres      : Corner resolution
//--    * l        : Corner length
//--    * th        : Corner thickness (not visible when ext_corner=false)
//--    * ext_corner: If the exterior corner is used as a reference

//--------------------------------------------------------------------------

--
View this message in context:
http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

your first link does not exist. can you provide an image of it? -- Extra Ham Operator: K7AZJ Registered Linux User: 275424 Raspberry Pi and Arduino developer *The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".*- Isaac. Asimov *I* *f you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. *- Anonymous *If writing good code requires very little comments, then writing really excellent code requires no comments at all!*- Ken Thompson On Wed, Dec 9, 2015 at 7:28 PM, vIQleS <nathan@lx1.co.nz> wrote: > Can anyone help me understand this pls? Still a noob, so I'm making no > headway with the "instructions"... > > I'm trying to do an indent ala: > > https://www.tinkercad.com/things/0Bsnpi3wsOY-copy-of-tray-for-penny-press-board-game-stacks-of-stories > > I thought I might be able to do it with the bevel library that I found: > http://www.thingiverse.com/thing:30336 > > But I have no idea what a coordinate is or how it fits in / is used here... > It seems to be an array of arrays. The comments from the library are at the > bottom of the code. > > Code is copied and pasted from one of the examples and I've tried to change > it to suit... > > Code: > > use <obiscad/bevel.scad> > use <obiscad/attach.scad> > > //-- Parts parameters > th = 3; > bsize = 1; > size = [bsize,60,th]; > rad=10; > > //-- The two ortogonal parts > translate([rad*2,0,0]) > cube(size,center=true); > > cylinder(th,rad,rad, $fn=100, center=true); > > //-- Define the connectors > ec = [ [0,rad,0], [0,0,0], 0]; > en = [ [0,rad,0], [rad*2+bsize/2,rad,0], 0]; > > //-- Debuging > *connector(ec3); > *connector(en3); > > > //-- 1 bigger rounded buttress > bconcave_corner_attach(ec,en,th,cr=8,cres=100, l=th); > > //[crn, ?, ?] > > > //--------------------------------------------------------------------------- > //-- API MODULE > //-- > //-- Attach a Beveled concave corner > //-- Two connectors are needed: > //-- * edge_c : Connector located on the edge, paralell to the edge > //-- * normal_c : Connector located on the same point than edge_c > //-- pointing to the internal corner part, in the direction > //-- of the corner bisector > //-- * cr : Corner radius > //-- * cres : Corner resolution > //-- * l : Corner length > //-- * th : Corner thickness (not visible when ext_corner=false) > //-- * ext_corner: If the exterior corner is used as a reference > > //-------------------------------------------------------------------------- > > > > -- > View this message in context: > http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
N
Neon22
Thu, Dec 10, 2015 5:28 AM

Try this one instead
http://www.thingiverse.com/thing:135408

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15079.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Try this one instead http://www.thingiverse.com/thing:135408 -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15079.html Sent from the OpenSCAD mailing list archive at Nabble.com.
V
vIQleS
Thu, Dec 10, 2015 9:03 AM
https://boardgamegeek.com/image/2556688/penny-press https://boardgamegeek.com/image/2555889/penny-press https://boardgamegeek.com/image/2555888/penny-press The sine wavy, indenty bit... -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15084.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Thu, Dec 10, 2015 10:25 AM

width = 10;
height = 30;
length = 100;
step = 1;

module bulge() {
for (i=[0:step:length]) {
hull () {
cube(size=[width, length*(i/length), cos(i*(length/45))height],
center=true);
cube(size=[width, length
((i+1)/length), cos((i+1)*(length/45))*height],
center=true);
}
}
}

difference() {
cube(size=[width-1, length, height], center=true);
translate([0,0,height/2])
bulge();
}

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15085.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

width = 10; height = 30; length = 100; step = 1; module bulge() { for (i=[0:step:length]) { hull () { cube(size=[width, length*(i/length), cos(i*(length/45))*height], center=true); cube(size=[width, length*((i+1)/length), cos((i+1)*(length/45))*height], center=true); } } } difference() { cube(size=[width-1, length, height], center=true); translate([0,0,height/2]) bulge(); } -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15085.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jpmendes
Thu, Dec 10, 2015 4:45 PM

Hi,
for sure  Neon22 is a programmer and an OpenSCAD expert.  The bulge() module
he offers takes into account the way OpenSCAD evaluates it's expressions and
calls itself in the end.
I'm not a programmer and I like the things more linear.
So if you are a beginner maybe, you will be more comfortable with the
following variation of bulge():

width = 10;
height = 30;
length = 100;
step =1;

module bulge1() {
difference() {
cube(size=[width-1, length, height], center=true);
translate([0,0,height/2])
for (i=[0:step:length]) {
hull () {
cube(size=[width, length*(i/length),
cos(i*(length/45))height], center=true);
cube(size=[width, length
((i+step)/length),
cos((i+step)*(length/45))*height], center=true);
}
}
}
}

bulge1();

Thanks Neon22 I'm also learning from you.

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15088.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, for sure Neon22 is a programmer and an OpenSCAD expert. The bulge() module he offers takes into account the way OpenSCAD evaluates it's expressions and calls itself in the end. I'm not a programmer and I like the things more linear. So if you are a beginner maybe, you will be more comfortable with the following variation of bulge(): width = 10; height = 30; length = 100; step =1; module bulge1() { difference() { cube(size=[width-1, length, height], center=true); translate([0,0,height/2]) for (i=[0:step:length]) { hull () { cube(size=[width, length*(i/length), cos(i*(length/45))*height], center=true); cube(size=[width, length*((i+step)/length), cos((i+step)*(length/45))*height], center=true); } } } } bulge1(); Thanks Neon22 I'm also learning from you. -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15088.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Fri, Dec 11, 2015 12:04 AM

@jpmendes Looks good.
The reason I did my approach (putting it into its own module) was so it
could be differenced from anything you want to subtract it from.

I see the original poster used, as reference, a card carrying unit with
several compartments.
So the bulge module could be subtracted (using difference) from any object
by positioning it and calling it several times.

E.g. (with some improvements)
wall_width = 10;
wall_height = 30;

module bulge(length, width, height) {
step = 1; // how smooth
count = 100;
for (i=[0:step:count]) {
hull () {
cube(size=[width, length*(i/count), cos(i*(count/45))height],
center=true);
cube(size=[width, length
((i+1)/count), cos((i+1)*(count/45))*height],
center=true);
}
}
}

difference() {
cube(size=[100, 100, wall_height], center=true);
#translate([50,0,wall_height/2])
bulge(100,wall_width,wall_height/2);
translate([-30,0,wall_height/2])
bulge(200,wall_width,wall_height);
translate([0,0,wall_height/2])
bulge(100,wall_width,wall_height);
}

http://forum.openscad.org/file/n15098/sine_indent-1.png

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15098.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@jpmendes Looks good. The reason I did my approach (putting it into its own module) was so it could be differenced from anything you want to subtract it from. I see the original poster used, as reference, a card carrying unit with several compartments. So the bulge module could be subtracted (using difference) from any object by positioning it and calling it several times. E.g. (with some improvements) wall_width = 10; wall_height = 30; module bulge(length, width, height) { step = 1; // how smooth count = 100; for (i=[0:step:count]) { hull () { cube(size=[width, length*(i/count), cos(i*(count/45))*height], center=true); cube(size=[width, length*((i+1)/count), cos((i+1)*(count/45))*height], center=true); } } } difference() { cube(size=[100, 100, wall_height], center=true); #translate([50,0,wall_height/2]) bulge(100,wall_width,wall_height/2); translate([-30,0,wall_height/2]) bulge(200,wall_width,wall_height); translate([0,0,wall_height/2]) bulge(100,wall_width,wall_height); } <http://forum.openscad.org/file/n15098/sine_indent-1.png> -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15098.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Fri, Dec 11, 2015 12:58 AM

Then again - if its rounded coreners you want @VIQleS then the simplest - but
least efficient - method is the minkowski.
E.g. in place of above example
Note - set sphere_res = 4 initially. then try 20 but wait a long time.
Also tray(); call at bottom takes argument true/false to enable rounding. So
you can run it with false and have quick feedback and only enable slow
minkowski rounding when you have model all sorted out and can afford to wait
:)

wall_width = 10;
wall_height = 30;
// how detailed is the rounding.
sphere_res = 4;  // 4=3mins but facets. 20=12mins and smooth

module bulge(length, width, height) {
step = 1; // how smooth
count = 100;
for (i=[1:step:count]) {
hull () {
cube(size=[width, length*(i/count), cos(i*(count/45))height],
center=true);
cube(size=[width, length
((i+1)/count), cos((i+1)*(count/45))*height],
center=true);
}
}
}

module tray(rounding=false) {
minkowski() {
difference() {
cube(size=[100, 100, wall_height], center=true);
// the indents
translate([50,0,wall_height/2])
bulge(100,wall_width,wall_height/2);
translate([-30,0,wall_height/2])
bulge(200,wall_width,wall_height);
translate([0,0,wall_height/2])
bulge(100,wall_width,wall_height);
}
if (rounding)
sphere(d=3, $fn=sphere_res);
}
}

tray();      // no rounding
// tray(true);  // corners rounded but takes a while...

http://forum.openscad.org/file/n15101/sine_indent_001272.png

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15101.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Then again - if its rounded coreners you want @VIQleS then the simplest - but least efficient - method is the minkowski. E.g. in place of above example Note - set sphere_res = 4 initially. then try 20 but wait a long time. Also tray(); call at bottom takes argument true/false to enable rounding. So you can run it with false and have quick feedback and only enable slow minkowski rounding when you have model all sorted out and can afford to wait :) wall_width = 10; wall_height = 30; // how detailed is the rounding. sphere_res = 4; // 4=3mins but facets. 20=12mins and smooth module bulge(length, width, height) { step = 1; // how smooth count = 100; for (i=[1:step:count]) { hull () { cube(size=[width, length*(i/count), cos(i*(count/45))*height], center=true); cube(size=[width, length*((i+1)/count), cos((i+1)*(count/45))*height], center=true); } } } module tray(rounding=false) { minkowski() { difference() { cube(size=[100, 100, wall_height], center=true); // the indents translate([50,0,wall_height/2]) bulge(100,wall_width,wall_height/2); translate([-30,0,wall_height/2]) bulge(200,wall_width,wall_height); translate([0,0,wall_height/2]) bulge(100,wall_width,wall_height); } if (rounding) sphere(d=3, $fn=sphere_res); } } tray(); // no rounding // tray(true); // corners rounded but takes a while... <http://forum.openscad.org/file/n15101/sine_indent_001272.png> -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15101.html Sent from the OpenSCAD mailing list archive at Nabble.com.
V
vIQleS
Fri, Dec 11, 2015 12:59 AM

That's almost exactly what I want - is there a way of doing a convex curve
near the top of the indent as per:

https://www.tinkercad.com/things/0Bsnpi3wsOY-ver-3-tray-for-penny-press-board-game-stacks-of-stories-meeples

?

On 11 December 2015 at 13:04, Neon22 [via OpenSCAD] <
ml-node+s1091067n15098h1@n5.nabble.com> wrote:

wall_width = 10;
wall_height = 30;

module bulge(length, width, height) {
step = 1; // how smooth
count = 100;
for (i=[0:step:count]) {
hull () {
cube(size=[width, length*(i/count),
cos(i*(count/45))height], center=true);
cube(size=[width, length
((i+1)/count),
cos((i+1)*(count/45))*height], center=true);
}
}
}

difference() {
cube(size=[100, 100, wall_height], center=true);
#translate([50,0,wall_height/2])
bulge(100,wall_width,wall_height/2);
translate([-30,0,wall_height/2])
bulge(200,wall_width,wall_height);
translate([0,0,wall_height/2])
bulge(100,wall_width,wall_height);

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15102.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

That's almost exactly what I want - is there a way of doing a convex curve near the top of the indent as per: https://www.tinkercad.com/things/0Bsnpi3wsOY-ver-3-tray-for-penny-press-board-game-stacks-of-stories-meeples ? On 11 December 2015 at 13:04, Neon22 [via OpenSCAD] < ml-node+s1091067n15098h1@n5.nabble.com> wrote: > wall_width = 10; > wall_height = 30; > > module bulge(length, width, height) { > step = 1; // how smooth > count = 100; > for (i=[0:step:count]) { > hull () { > cube(size=[width, length*(i/count), > cos(i*(count/45))*height], center=true); > cube(size=[width, length*((i+1)/count), > cos((i+1)*(count/45))*height], center=true); > } > } > } > > > difference() { > cube(size=[100, 100, wall_height], center=true); > #translate([50,0,wall_height/2]) > bulge(100,wall_width,wall_height/2); > translate([-30,0,wall_height/2]) > bulge(200,wall_width,wall_height); > translate([0,0,wall_height/2]) > bulge(100,wall_width,wall_height); > -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15102.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Sat, Dec 12, 2015 10:56 AM

Of course.
Here's a much improved Bulge as well. Works properly now - unlike the
rubbish I posted before.
The approach below uses Hull() a lot which is a bit slow.
Also the rounding uses Minkowski() which is exceedingly slow.
Increase smoothing params with care.

  • Commented out options at the end....

// For Bulge
wall_width = 10;
wall_height = 30;
curve_res = 20;  // for bulge - 100 is high quality

// how smooth is the rounding.
sphere_res = 4;  // 4=3mins but facets. 20=12mins and smooth

// Bulge based on sin()
module bulge(length, width, height, samples=100) {
// samples = smoothness of curve (20..100)
stride = length/(samples+1); // each step is this long
for (i=[0:1:samples-1]) {
hull () {
translate([0,stridei,0])
cube(size=[width, stride, sin(180
((i==0) ? 0.01: i)/samples)height]);
translate([0,stride
(i+1),0])
cube(size=[width, stride, sin(180*(i+0.99)/samples)*height]);
}
}
}

// Easein/out shaped curve (combined Bulges)
module ease(length, width, height, extra=0.1) {
part = length/2;
translate([0,part/2,height/2])
difference() {
union() {
// add together central bulge and filler underneath
translate([0,0,-extra/2])
bulge(part, width, height/2, curve_res);
translate([width/2,part/2,-extra/2-height/4])
cube(size=[width-.01,part*2,extra+height/2], center=true);
}
// subtract the inverted outer curves
mirror([0,0,1]) {
translate([0,-part,-extra/2])
bulge(part, width, height/2, curve_res);
translate([0,part,-extra/2])
bulge(part, width, height/2, curve_res);
}
}
}

module tray(rounding=false) {
minkowski() {
difference() {
cube(size=[100, 100, wall_height], center=true);
// the indents
mirror([0,0,1]) {
translate([45,-25,-wall_height/2])
ease(50,wall_width,wall_height/2);
translate([-30,-44,-wall_height/2])
ease(88,wall_width,wall_height/4);
translate([0,-25,-wall_height/2])
ease(50,wall_width,wall_height/6);
}
}
if (rounding)
sphere(d=3, $fn=sphere_res);
}
}

tray();      // no rounding
// tray(true);  // corners rounded but takes a while...
// bulge(100,10,30);
// ease(100,10,30);
http://forum.openscad.org/file/n15124/bulge_easing.png

--
View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15124.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Of course. Here's a much improved Bulge as well. Works properly now - unlike the rubbish I posted before. The approach below uses Hull() a lot which is a bit slow. Also the rounding uses Minkowski() which is exceedingly slow. Increase smoothing params with care. - Commented out options at the end.... // For Bulge wall_width = 10; wall_height = 30; curve_res = 20; // for bulge - 100 is high quality // how smooth is the rounding. sphere_res = 4; // 4=3mins but facets. 20=12mins and smooth // Bulge based on sin() module bulge(length, width, height, samples=100) { // samples = smoothness of curve (20..100) stride = length/(samples+1); // each step is this long for (i=[0:1:samples-1]) { hull () { translate([0,stride*i,0]) cube(size=[width, stride, sin(180*((i==0) ? 0.01: i)/samples)*height]); translate([0,stride*(i+1),0]) cube(size=[width, stride, sin(180*(i+0.99)/samples)*height]); } } } // Easein/out shaped curve (combined Bulges) module ease(length, width, height, extra=0.1) { part = length/2; translate([0,part/2,height/2]) difference() { union() { // add together central bulge and filler underneath translate([0,0,-extra/2]) bulge(part, width, height/2, curve_res); translate([width/2,part/2,-extra/2-height/4]) cube(size=[width-.01,part*2,extra+height/2], center=true); } // subtract the inverted outer curves mirror([0,0,1]) { translate([0,-part,-extra/2]) bulge(part, width, height/2, curve_res); translate([0,part,-extra/2]) bulge(part, width, height/2, curve_res); } } } module tray(rounding=false) { minkowski() { difference() { cube(size=[100, 100, wall_height], center=true); // the indents mirror([0,0,1]) { translate([45,-25,-wall_height/2]) ease(50,wall_width,wall_height/2); translate([-30,-44,-wall_height/2]) ease(88,wall_width,wall_height/4); translate([0,-25,-wall_height/2]) ease(50,wall_width,wall_height/6); } } if (rounding) sphere(d=3, $fn=sphere_res); } } tray(); // no rounding // tray(true); // corners rounded but takes a while... // bulge(100,10,30); // ease(100,10,30); <http://forum.openscad.org/file/n15124/bulge_easing.png> -- View this message in context: http://forum.openscad.org/Using-bevel-library-what-is-a-connector-tp15076p15124.html Sent from the OpenSCAD mailing list archive at Nabble.com.