discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

morph a rectangle shape to a cylinder shape?

FP
Frank Paynter
Thu, Jul 8, 2021 4:52 PM

Hi,

I need to create a 3D shape that starts out as a hollow rectangle and ends
up as a hollow cylinder.  Are there any SCAD scripts for this?

TIA,

Frank

--
G.Frank Paynter, PhD
OSU ESL Research Scientist (ret)
EM Workbench LLC
614 638-6749 (cell)

Hi, I need to create a 3D shape that starts out as a hollow rectangle and ends up as a hollow cylinder. Are there any SCAD scripts for this? TIA, Frank -- G.Frank Paynter, PhD OSU ESL Research Scientist (ret) EM Workbench LLC 614 638-6749 (cell)
NH
nop head
Thu, Jul 8, 2021 5:03 PM

Take the hull of a very thin cylinder and a square to form the outer shape.
Subtract a smaller but slightly longer version to make it hollow.

On Thu, 8 Jul 2021 at 17:52, Frank Paynter paynterf@gmail.com wrote:

Hi,

I need to create a 3D shape that starts out as a hollow rectangle and ends
up as a hollow cylinder.  Are there any SCAD scripts for this?

TIA,

Frank

--
G.Frank Paynter, PhD
OSU ESL Research Scientist (ret)
EM Workbench LLC
614 638-6749 (cell)


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Take the hull of a very thin cylinder and a square to form the outer shape. Subtract a smaller but slightly longer version to make it hollow. On Thu, 8 Jul 2021 at 17:52, Frank Paynter <paynterf@gmail.com> wrote: > Hi, > > I need to create a 3D shape that starts out as a hollow rectangle and ends > up as a hollow cylinder. Are there any SCAD scripts for this? > > TIA, > > Frank > > > -- > G.Frank Paynter, PhD > OSU ESL Research Scientist (ret) > EM Workbench LLC > 614 638-6749 (cell) > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Thu, Jul 8, 2021 5:47 PM

If you want an option that is more curved, without the triangular faces on
the side you can look at

https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-skin

Examples 11 and 12.

On Thu, Jul 8, 2021 at 1:04 PM nop head nop.head@gmail.com wrote:

Take the hull of a very thin cylinder and a square to form the outer
shape. Subtract a smaller but slightly longer version to make it hollow.

On Thu, 8 Jul 2021 at 17:52, Frank Paynter paynterf@gmail.com wrote:

Hi,

I need to create a 3D shape that starts out as a hollow rectangle and
ends up as a hollow cylinder.  Are there any SCAD scripts for this?

TIA,

Frank

--
G.Frank Paynter, PhD
OSU ESL Research Scientist (ret)
EM Workbench LLC
614 638-6749 (cell)


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

If you want an option that is more curved, without the triangular faces on the side you can look at https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-skin Examples 11 and 12. On Thu, Jul 8, 2021 at 1:04 PM nop head <nop.head@gmail.com> wrote: > Take the hull of a very thin cylinder and a square to form the outer > shape. Subtract a smaller but slightly longer version to make it hollow. > > On Thu, 8 Jul 2021 at 17:52, Frank Paynter <paynterf@gmail.com> wrote: > >> Hi, >> >> I need to create a 3D shape that starts out as a hollow rectangle and >> ends up as a hollow cylinder. Are there any SCAD scripts for this? >> >> TIA, >> >> Frank >> >> >> -- >> G.Frank Paynter, PhD >> OSU ESL Research Scientist (ret) >> EM Workbench LLC >> 614 638-6749 (cell) >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
CA
Carsten Arnholm
Thu, Jul 8, 2021 6:14 PM

On 08.07.2021 18:52, Frank Paynter wrote:

I need to create a 3D shape that starts out as a hollow rectangle and
ends up as a hollow cylinder.  Are there any SCAD scripts for this?

Well, you might be able to write one based on this AngelCAD script. See
the STL included there for the result.

https://gist.github.com/arnholm/b798d062ab914eb19dffce751ed86427

Carsten Arholm

On 08.07.2021 18:52, Frank Paynter wrote: > I need to create a 3D shape that starts out as a hollow rectangle and > ends up as a hollow cylinder.  Are there any SCAD scripts for this? Well, you might be able to write one based on this AngelCAD script. See the STL included there for the result. https://gist.github.com/arnholm/b798d062ab914eb19dffce751ed86427 Carsten Arholm
RW
Rogier Wolff
Thu, Jul 8, 2021 6:30 PM

On Thu, Jul 08, 2021 at 12:52:04PM -0400, Frank Paynter wrote:

I need to create a 3D shape that starts out as a hollow rectangle and ends
up as a hollow cylinder.  Are there any SCAD scripts for this?

Yup. 3 minutes work:


dcyl = 40;
dsqu = 40;

wt = 2;

hh = 40;

module cylsqu (ds, dcy, hh)
{
dh = .5;
hull () {
cylinder (d=ds, h=dh, $fn=4);
translate ([0,0,hh-dh]) cylinder (d=dcy, h=dh, $fn=60);
}
}

module hcylsqu (ds, dcy, hh)
{
difference () {
cylsqu (dsqu+2wt, dcyl+2wt, hh);
translate ([0,0,-0.01]) cylsqu (dsqu, dcyl, hh+.02);

}
}

hcylsqu (dsqu, dcyl, hh);


Adapting from "square" as implemented to "rectangle" is left as an
excercise for the reader.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Thu, Jul 08, 2021 at 12:52:04PM -0400, Frank Paynter wrote: > I need to create a 3D shape that starts out as a hollow rectangle and ends > up as a hollow cylinder. Are there any SCAD scripts for this? Yup. 3 minutes work: ------------------------- dcyl = 40; dsqu = 40; wt = 2; hh = 40; module cylsqu (ds, dcy, hh) { dh = .5; hull () { cylinder (d=ds, h=dh, $fn=4); translate ([0,0,hh-dh]) cylinder (d=dcy, h=dh, $fn=60); } } module hcylsqu (ds, dcy, hh) { difference () { cylsqu (dsqu+2*wt, dcyl+2*wt, hh); translate ([0,0,-0.01]) cylsqu (dsqu, dcyl, hh+.02); } } hcylsqu (dsqu, dcyl, hh); ------------------------- Adapting from "square" as implemented to "rectangle" is left as an excercise for the reader. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
FP
Frank Paynter
Fri, Jul 9, 2021 1:57 PM

Wow!  I'm in love with hull()!!  Thanks Roger!!

Yup. 3 minutes work:


dcyl = 40;
dsqu = 40;

wt = 2;

hh = 40;

module cylsqu (ds, dcy, hh)
{
dh = .5;
hull () {
cylinder (d=ds, h=dh, $fn=4);
translate ([0,0,hh-dh]) cylinder (d=dcy, h=dh, $fn=60);
}
}

module hcylsqu (ds, dcy, hh)
{
difference () {
cylsqu (dsqu+2wt, dcyl+2wt, hh);
translate ([0,0,-0.01]) cylsqu (dsqu, dcyl, hh+.02);

}
}

hcylsqu (dsqu, dcyl, hh);


Adapting from "square" as implemented to "rectangle" is left as an
excercise for the reader.

    Roger.

On Thu, Jul 8, 2021 at 12:52 PM Frank Paynter paynterf@gmail.com wrote:

Hi,

I need to create a 3D shape that starts out as a hollow rectangle and ends
up as a hollow cylinder.  Are there any SCAD scripts for this?

TIA,

Frank

--
G.Frank Paynter, PhD
OSU ESL Research Scientist (ret)
EM Workbench LLC
614 638-6749 (cell)

--
G.Frank Paynter, PhD
OSU ESL Research Scientist (ret)
EM Workbench LLC
614 638-6749 (cell)

Wow! I'm in love with hull()!! Thanks Roger!! Yup. 3 minutes work: ------------------------- dcyl = 40; dsqu = 40; wt = 2; hh = 40; module cylsqu (ds, dcy, hh) { dh = .5; hull () { cylinder (d=ds, h=dh, $fn=4); translate ([0,0,hh-dh]) cylinder (d=dcy, h=dh, $fn=60); } } module hcylsqu (ds, dcy, hh) { difference () { cylsqu (dsqu+2*wt, dcyl+2*wt, hh); translate ([0,0,-0.01]) cylsqu (dsqu, dcyl, hh+.02); } } hcylsqu (dsqu, dcyl, hh); ------------------------- Adapting from "square" as implemented to "rectangle" is left as an excercise for the reader. Roger. On Thu, Jul 8, 2021 at 12:52 PM Frank Paynter <paynterf@gmail.com> wrote: > Hi, > > I need to create a 3D shape that starts out as a hollow rectangle and ends > up as a hollow cylinder. Are there any SCAD scripts for this? > > TIA, > > Frank > > > -- > G.Frank Paynter, PhD > OSU ESL Research Scientist (ret) > EM Workbench LLC > 614 638-6749 (cell) > -- G.Frank Paynter, PhD OSU ESL Research Scientist (ret) EM Workbench LLC 614 638-6749 (cell)