discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

painted myself into a corner

J
jon
Sun, Dec 11, 2022 11:04 PM

No need for a cone and a pyramid.  A circle and a square will do.

On 12/11/2022 5:33 PM, Steve Lelievre wrote:

FYI,

I know that this thread is old now so interest will have waned and the
OP's requirement has been solved ... but I just realized that there is
a better way than I suggested in my original post from weeks ago, for
morphing a tube from having a rectangular end to a circular end (which
is what the OP wanted to do for a fan housing.)

The transition can be achieved, both exactly and code-efficiently, by
hulling a cone and an inverted pyramid. I implemented this solution as
the very small module called morph contained in the code pasted after
my signature (feel free to copy/adapt). To convert the morphed shape
to a hollow tube you either use Minkowski or make slightly oversize
version of the same shape, then subtract the original shape to leave
only walls (see the notes in my code.)

More generally, if you want to morph any polygon to any other polygon,
such as a pentagon to octagon as shown here, you just hull together a
cone and an inverted cone, setting the number of sides required for
each cone by supplying $fn parameters.

Cheers,

Steve

$fn = 60;

module morph(h, d, x, y) {
   // Morphs a rectangle to a circle. By Steve Lelievre, 2022.
   // h: transition height.
   // d: diameter of circular lower end.
   // x: x dimension (length) of rectangular upper end.
   // y: y dimension (width) of rectangular upper end.
   hull() {
      resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone
      resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, $fn
= 4); // inverted pyramid
   }
}

// Example usage
translate([-15, 0, 0]) morph(30, 25, 15, 12);

// Code snippet to demonstrate how the morph works
translate([-45, 0, 0]) union() {
   color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 =
1);  // cone
   color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = 1,
r1 = 1, r2 = 0, $fn = 4); // inverted pyramid
   color("silver", 0.3) morph(30, 25, 15, 12);
}

// Extending the idea to make a tubular connector:

// Option A. Using Minkowski ensures wall thickness is exactly as
specified when measured in cross section.
// Corners of the rectangular end are rounded accordingly. THe corner
radius is the wall thickness.

module tubeA(h, d, x, y, w) {
   // Creates an open tube by Minkowski addition of a sphere to an
internal shape,
   // followed by trimming back to height and then subtraction of the
internal shape to hollow out the tube.
   // w: wall thickness. This is the thickness in cross section (what
would usually be considered the 'true' value).
   // The other parameters are those used in the morph module.

   sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // maximum
radius needed for trimming cylinder
   difference() {
      intersection() {
         minkowski() {
            morph(h, d, x, y);
            sphere(r = w);
         }
         cylinder(h = h, r = sizeLimit);
      }
      morph(h, d, x, y);
   }
}

translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1);

// Option B. Subtract inner shape from geometrically similar but
slightly larger outer shape.
// Gives square corners to rectangular end.
// !!! However, in some cases, the wall's cross section will be
thinner than this value !!!

module tubeB(h, d, x, y, w) {
   // w: wall thickness in horizontal section.
   // The other parameters are those used in the morph module.

   difference() {
      morph(h, d + 2 * w, x + 2 * w, y + 2 * w);
      morph(h, d, x, y);
   }
}

translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1);

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 2022-11-13 3:00 p.m., Steve Lelievre wrote:

I'm not entirely clear what shape you're aiming for; is it something
like this? (once adjusted for your exact dimensions)

Steve


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

No need for a cone and a pyramid.  A circle and a square will do. On 12/11/2022 5:33 PM, Steve Lelievre wrote: > > FYI, > > I know that this thread is old now so interest will have waned and the > OP's requirement has been solved ... but I just realized that there is > a better way than I suggested in my original post from weeks ago, for > morphing a tube from having a rectangular end to a circular end (which > is what the OP wanted to do for a fan housing.) > > The transition can be achieved, both exactly and code-efficiently, by > hulling a cone and an inverted pyramid. I implemented this solution as > the very small module called morph contained in the code pasted after > my signature (feel free to copy/adapt). To convert the morphed shape > to a hollow tube you either use Minkowski or make slightly oversize > version of the same shape, then subtract the original shape to leave > only walls (see the notes in my code.) > > > > More generally, if you want to morph any polygon to any other polygon, > such as a pentagon to octagon as shown here, you just hull together a > cone and an inverted cone, setting the number of sides required for > each cone by supplying $fn parameters. > > Cheers, > > Steve > > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > $fn = 60; > > > module morph(h, d, x, y) { >    // Morphs a rectangle to a circle. By Steve Lelievre, 2022. >    // h: transition height. >    // d: diameter of circular lower end. >    // x: x dimension (length) of rectangular upper end. >    // y: y dimension (width) of rectangular upper end. >    hull() { >       resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone >       resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, $fn > = 4); // inverted pyramid >    } > } > > // Example usage > translate([-15, 0, 0]) morph(30, 25, 15, 12); > > // Code snippet to demonstrate how the morph works > translate([-45, 0, 0]) union() { >    color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 = > 1);  // cone >    color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = 1, > r1 = 1, r2 = 0, $fn = 4); // inverted pyramid >    color("silver", 0.3) morph(30, 25, 15, 12); > } > > // Extending the idea to make a tubular connector: > > // Option A. Using Minkowski ensures wall thickness is exactly as > specified when measured in cross section. > // Corners of the rectangular end are rounded accordingly. THe corner > radius is the wall thickness. > > module tubeA(h, d, x, y, w) { >    // Creates an open tube by Minkowski addition of a sphere to an > internal shape, >    // followed by trimming back to height and then subtraction of the > internal shape to hollow out the tube. >    // w: wall thickness. This is the thickness in cross section (what > would usually be considered the 'true' value). >    // The other parameters are those used in the morph module. > >    sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // maximum > radius needed for trimming cylinder >    difference() { >       intersection() { >          minkowski() { >             morph(h, d, x, y); >             sphere(r = w); >          } >          cylinder(h = h, r = sizeLimit); >       } >       morph(h, d, x, y); >    } > } > > translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1); > > // Option B. Subtract inner shape from geometrically similar but > slightly larger outer shape. > // Gives square corners to rectangular end. > // !!! However, in some cases, the wall's cross section will be > thinner than this value !!! > > module tubeB(h, d, x, y, w) { >    // w: wall thickness in horizontal section. >    // The other parameters are those used in the morph module. > >    difference() { >       morph(h, d + 2 * w, x + 2 * w, y + 2 * w); >       morph(h, d, x, y); >    } > } > > translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1); > > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > > > On 2022-11-13 3:00 p.m., Steve Lelievre wrote: >> >> I'm not entirely clear what shape you're aiming for; is it something >> like this? (once adjusted for your exact dimensions) >> >> Steve >> >> >> >> > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
SL
Steve Lelievre
Sun, Dec 11, 2022 11:36 PM

Hi,

On 2022-12-11 3:04 p.m., jon wrote:

No need for a cone and a pyramid.  A circle and a square will do.

I need to be told how.

Because hulling 2D shapes to get a 3D shape is not possible, I just
can't see a method to achieve the shape directly from a square and a
circle.

That is, unless you actually mean a very thin disk and very thin cube.
That is what I originally came up with but am replacing because it was a
little more complex and doesn't produce a geometrically-correct transition.

Thanks,

Steve

On 12/11/2022 5:33 PM, Steve Lelievre wrote:

FYI,

I know that this thread is old now so interest will have waned and
the OP's requirement has been solved ... but I just realized that
there is a better way than I suggested in my original post from weeks
ago, for morphing a tube from having a rectangular end to a circular
end (which is what the OP wanted to do for a fan housing.)

The transition can be achieved, both exactly and code-efficiently, by
hulling a cone and an inverted pyramid. I implemented this solution
as the very small module called morph contained in the code pasted
after my signature (feel free to copy/adapt). To convert the morphed
shape to a hollow tube you either use Minkowski or make slightly
oversize version of the same shape, then subtract the original shape
to leave only walls (see the notes in my code.)

More generally, if you want to morph any polygon to any other
polygon, such as a pentagon to octagon as shown here, you just hull
together a cone and an inverted cone, setting the number of sides
required for each cone by supplying $fn parameters.

Cheers,

Steve

$fn = 60;

module morph(h, d, x, y) {
   // Morphs a rectangle to a circle. By Steve Lelievre, 2022.
   // h: transition height.
   // d: diameter of circular lower end.
   // x: x dimension (length) of rectangular upper end.
   // y: y dimension (width) of rectangular upper end.
   hull() {
      resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone
      resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0,
$fn = 4); // inverted pyramid
   }
}

// Example usage
translate([-15, 0, 0]) morph(30, 25, 15, 12);

// Code snippet to demonstrate how the morph works
translate([-45, 0, 0]) union() {
   color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2
= 1);  // cone
   color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h =
1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid
   color("silver", 0.3) morph(30, 25, 15, 12);
}

// Extending the idea to make a tubular connector:

// Option A. Using Minkowski ensures wall thickness is exactly as
specified when measured in cross section.
// Corners of the rectangular end are rounded accordingly. THe corner
radius is the wall thickness.

module tubeA(h, d, x, y, w) {
   // Creates an open tube by Minkowski addition of a sphere to an
internal shape,
   // followed by trimming back to height and then subtraction of the
internal shape to hollow out the tube.
   // w: wall thickness. This is the thickness in cross section (what
would usually be considered the 'true' value).
   // The other parameters are those used in the morph module.

   sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); //
maximum radius needed for trimming cylinder
   difference() {
      intersection() {
         minkowski() {
            morph(h, d, x, y);
            sphere(r = w);
         }
         cylinder(h = h, r = sizeLimit);
      }
      morph(h, d, x, y);
   }
}

translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1);

// Option B. Subtract inner shape from geometrically similar but
slightly larger outer shape.
// Gives square corners to rectangular end.
// !!! However, in some cases, the wall's cross section will be
thinner than this value !!!

module tubeB(h, d, x, y, w) {
   // w: wall thickness in horizontal section.
   // The other parameters are those used in the morph module.

   difference() {
      morph(h, d + 2 * w, x + 2 * w, y + 2 * w);
      morph(h, d, x, y);
   }
}

translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1);

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 2022-11-13 3:00 p.m., Steve Lelievre wrote:

I'm not entirely clear what shape you're aiming for; is it something
like this? (once adjusted for your exact dimensions)

Steve


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

Hi, On 2022-12-11 3:04 p.m., jon wrote: > > No need for a cone and a pyramid.  A circle and a square will do. > I need to be told how. Because hulling 2D shapes to get a 3D shape is not possible, I just can't see a method to achieve the shape directly from a square and a circle. That is, unless you actually mean a very thin disk and very thin cube. That is what I originally came up with but am replacing because it was a little more complex and doesn't produce a geometrically-correct transition. Thanks, Steve > On 12/11/2022 5:33 PM, Steve Lelievre wrote: >> >> FYI, >> >> I know that this thread is old now so interest will have waned and >> the OP's requirement has been solved ... but I just realized that >> there is a better way than I suggested in my original post from weeks >> ago, for morphing a tube from having a rectangular end to a circular >> end (which is what the OP wanted to do for a fan housing.) >> >> The transition can be achieved, both exactly and code-efficiently, by >> hulling a cone and an inverted pyramid. I implemented this solution >> as the very small module called morph contained in the code pasted >> after my signature (feel free to copy/adapt). To convert the morphed >> shape to a hollow tube you either use Minkowski or make slightly >> oversize version of the same shape, then subtract the original shape >> to leave only walls (see the notes in my code.) >> >> >> >> More generally, if you want to morph any polygon to any other >> polygon, such as a pentagon to octagon as shown here, you just hull >> together a cone and an inverted cone, setting the number of sides >> required for each cone by supplying $fn parameters. >> >> Cheers, >> >> Steve >> >> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> >> $fn = 60; >> >> >> module morph(h, d, x, y) { >>    // Morphs a rectangle to a circle. By Steve Lelievre, 2022. >>    // h: transition height. >>    // d: diameter of circular lower end. >>    // x: x dimension (length) of rectangular upper end. >>    // y: y dimension (width) of rectangular upper end. >>    hull() { >>       resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone >>       resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, >> $fn = 4); // inverted pyramid >>    } >> } >> >> // Example usage >> translate([-15, 0, 0]) morph(30, 25, 15, 12); >> >> // Code snippet to demonstrate how the morph works >> translate([-45, 0, 0]) union() { >>    color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 >> = 1);  // cone >>    color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = >> 1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid >>    color("silver", 0.3) morph(30, 25, 15, 12); >> } >> >> // Extending the idea to make a tubular connector: >> >> // Option A. Using Minkowski ensures wall thickness is exactly as >> specified when measured in cross section. >> // Corners of the rectangular end are rounded accordingly. THe corner >> radius is the wall thickness. >> >> module tubeA(h, d, x, y, w) { >>    // Creates an open tube by Minkowski addition of a sphere to an >> internal shape, >>    // followed by trimming back to height and then subtraction of the >> internal shape to hollow out the tube. >>    // w: wall thickness. This is the thickness in cross section (what >> would usually be considered the 'true' value). >>    // The other parameters are those used in the morph module. >> >>    sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // >> maximum radius needed for trimming cylinder >>    difference() { >>       intersection() { >>          minkowski() { >>             morph(h, d, x, y); >>             sphere(r = w); >>          } >>          cylinder(h = h, r = sizeLimit); >>       } >>       morph(h, d, x, y); >>    } >> } >> >> translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1); >> >> // Option B. Subtract inner shape from geometrically similar but >> slightly larger outer shape. >> // Gives square corners to rectangular end. >> // !!! However, in some cases, the wall's cross section will be >> thinner than this value !!! >> >> module tubeB(h, d, x, y, w) { >>    // w: wall thickness in horizontal section. >>    // The other parameters are those used in the morph module. >> >>    difference() { >>       morph(h, d + 2 * w, x + 2 * w, y + 2 * w); >>       morph(h, d, x, y); >>    } >> } >> >> translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1); >> >> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >> >> >> On 2022-11-13 3:00 p.m., Steve Lelievre wrote: >>> >>> I'm not entirely clear what shape you're aiming for; is it something >>> like this? (once adjusted for your exact dimensions) >>> >>> Steve >>> >>> >>> >>> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org
J
jon
Sun, Dec 11, 2022 11:37 PM

Yes.  A circle and a square linearly extruded to be 0.01 mm thick. 
Interesting that this approach did not work for you.  I wonder why.

On 12/11/2022 6:36 PM, Steve Lelievre wrote:

Hi,

On 2022-12-11 3:04 p.m., jon wrote:

No need for a cone and a pyramid.  A circle and a square will do.

I need to be told how.

Because hulling 2D shapes to get a 3D shape is not possible, I just
can't see a method to achieve the shape directly from a square and a
circle.

That is, unless you actually mean a very thin disk and very thin cube.
That is what I originally came up with but am replacing because it was
a little more complex and doesn't produce a geometrically-correct
transition.

Thanks,

Steve

On 12/11/2022 5:33 PM, Steve Lelievre wrote:

FYI,

I know that this thread is old now so interest will have waned and
the OP's requirement has been solved ... but I just realized that
there is a better way than I suggested in my original post from
weeks ago, for morphing a tube from having a rectangular end to a
circular end (which is what the OP wanted to do for a fan housing.)

The transition can be achieved, both exactly and code-efficiently,
by hulling a cone and an inverted pyramid. I implemented this
solution as the very small module called morph contained in the code
pasted after my signature (feel free to copy/adapt). To convert the
morphed shape to a hollow tube you either use Minkowski or make
slightly oversize version of the same shape, then subtract the
original shape to leave only walls (see the notes in my code.)

More generally, if you want to morph any polygon to any other
polygon, such as a pentagon to octagon as shown here, you just hull
together a cone and an inverted cone, setting the number of sides
required for each cone by supplying $fn parameters.

Cheers,

Steve

$fn = 60;

module morph(h, d, x, y) {
   // Morphs a rectangle to a circle. By Steve Lelievre, 2022.
   // h: transition height.
   // d: diameter of circular lower end.
   // x: x dimension (length) of rectangular upper end.
   // y: y dimension (width) of rectangular upper end.
   hull() {
      resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone
      resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0,
$fn = 4); // inverted pyramid
   }
}

// Example usage
translate([-15, 0, 0]) morph(30, 25, 15, 12);

// Code snippet to demonstrate how the morph works
translate([-45, 0, 0]) union() {
   color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2
= 1);  // cone
   color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h =
1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid
   color("silver", 0.3) morph(30, 25, 15, 12);
}

// Extending the idea to make a tubular connector:

// Option A. Using Minkowski ensures wall thickness is exactly as
specified when measured in cross section.
// Corners of the rectangular end are rounded accordingly. THe
corner radius is the wall thickness.

module tubeA(h, d, x, y, w) {
   // Creates an open tube by Minkowski addition of a sphere to an
internal shape,
   // followed by trimming back to height and then subtraction of
the internal shape to hollow out the tube.
   // w: wall thickness. This is the thickness in cross section
(what would usually be considered the 'true' value).
   // The other parameters are those used in the morph module.

   sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); //
maximum radius needed for trimming cylinder
   difference() {
      intersection() {
         minkowski() {
            morph(h, d, x, y);
            sphere(r = w);
         }
         cylinder(h = h, r = sizeLimit);
      }
      morph(h, d, x, y);
   }
}

translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1);

// Option B. Subtract inner shape from geometrically similar but
slightly larger outer shape.
// Gives square corners to rectangular end.
// !!! However, in some cases, the wall's cross section will be
thinner than this value !!!

module tubeB(h, d, x, y, w) {
   // w: wall thickness in horizontal section.
   // The other parameters are those used in the morph module.

   difference() {
      morph(h, d + 2 * w, x + 2 * w, y + 2 * w);
      morph(h, d, x, y);
   }
}

translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1);

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 2022-11-13 3:00 p.m., Steve Lelievre wrote:

I'm not entirely clear what shape you're aiming for; is it
something like this? (once adjusted for your exact dimensions)

Steve


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

Yes.  A circle and a square linearly extruded to be 0.01 mm thick.  Interesting that this approach did not work for you.  I wonder why. On 12/11/2022 6:36 PM, Steve Lelievre wrote: > Hi, > > On 2022-12-11 3:04 p.m., jon wrote: >> >> No need for a cone and a pyramid.  A circle and a square will do. >> > I need to be told how. > > Because hulling 2D shapes to get a 3D shape is not possible, I just > can't see a method to achieve the shape directly from a square and a > circle. > > That is, unless you actually mean a very thin disk and very thin cube. > That is what I originally came up with but am replacing because it was > a little more complex and doesn't produce a geometrically-correct > transition. > > Thanks, > > Steve > > >> On 12/11/2022 5:33 PM, Steve Lelievre wrote: >>> >>> FYI, >>> >>> I know that this thread is old now so interest will have waned and >>> the OP's requirement has been solved ... but I just realized that >>> there is a better way than I suggested in my original post from >>> weeks ago, for morphing a tube from having a rectangular end to a >>> circular end (which is what the OP wanted to do for a fan housing.) >>> >>> The transition can be achieved, both exactly and code-efficiently, >>> by hulling a cone and an inverted pyramid. I implemented this >>> solution as the very small module called morph contained in the code >>> pasted after my signature (feel free to copy/adapt). To convert the >>> morphed shape to a hollow tube you either use Minkowski or make >>> slightly oversize version of the same shape, then subtract the >>> original shape to leave only walls (see the notes in my code.) >>> >>> >>> >>> More generally, if you want to morph any polygon to any other >>> polygon, such as a pentagon to octagon as shown here, you just hull >>> together a cone and an inverted cone, setting the number of sides >>> required for each cone by supplying $fn parameters. >>> >>> Cheers, >>> >>> Steve >>> >>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>> >>> $fn = 60; >>> >>> >>> module morph(h, d, x, y) { >>>    // Morphs a rectangle to a circle. By Steve Lelievre, 2022. >>>    // h: transition height. >>>    // d: diameter of circular lower end. >>>    // x: x dimension (length) of rectangular upper end. >>>    // y: y dimension (width) of rectangular upper end. >>>    hull() { >>>       resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone >>>       resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, >>> $fn = 4); // inverted pyramid >>>    } >>> } >>> >>> // Example usage >>> translate([-15, 0, 0]) morph(30, 25, 15, 12); >>> >>> // Code snippet to demonstrate how the morph works >>> translate([-45, 0, 0]) union() { >>>    color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 >>> = 1);  // cone >>>    color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = >>> 1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid >>>    color("silver", 0.3) morph(30, 25, 15, 12); >>> } >>> >>> // Extending the idea to make a tubular connector: >>> >>> // Option A. Using Minkowski ensures wall thickness is exactly as >>> specified when measured in cross section. >>> // Corners of the rectangular end are rounded accordingly. THe >>> corner radius is the wall thickness. >>> >>> module tubeA(h, d, x, y, w) { >>>    // Creates an open tube by Minkowski addition of a sphere to an >>> internal shape, >>>    // followed by trimming back to height and then subtraction of >>> the internal shape to hollow out the tube. >>>    // w: wall thickness. This is the thickness in cross section >>> (what would usually be considered the 'true' value). >>>    // The other parameters are those used in the morph module. >>> >>>    sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // >>> maximum radius needed for trimming cylinder >>>    difference() { >>>       intersection() { >>>          minkowski() { >>>             morph(h, d, x, y); >>>             sphere(r = w); >>>          } >>>          cylinder(h = h, r = sizeLimit); >>>       } >>>       morph(h, d, x, y); >>>    } >>> } >>> >>> translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1); >>> >>> // Option B. Subtract inner shape from geometrically similar but >>> slightly larger outer shape. >>> // Gives square corners to rectangular end. >>> // !!! However, in some cases, the wall's cross section will be >>> thinner than this value !!! >>> >>> module tubeB(h, d, x, y, w) { >>>    // w: wall thickness in horizontal section. >>>    // The other parameters are those used in the morph module. >>> >>>    difference() { >>>       morph(h, d + 2 * w, x + 2 * w, y + 2 * w); >>>       morph(h, d, x, y); >>>    } >>> } >>> >>> translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1); >>> >>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>> >>> >>> On 2022-11-13 3:00 p.m., Steve Lelievre wrote: >>>> >>>> I'm not entirely clear what shape you're aiming for; is it >>>> something like this? (once adjusted for your exact dimensions) >>>> >>>> Steve >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email todiscuss-leave@lists.openscad.org
NH
nop head
Sun, Dec 11, 2022 11:45 PM

Well they are cubes and cylinders once extruded.

A cone is better because it has one set of edges instead of two sets very
close together. The cone could be very short to make it almost flat.

On Sun, 11 Dec 2022 at 23:38, Steve Lelievre <
steve.lelievre.canada@gmail.com> wrote:

Hi,

On 2022-12-11 3:04 p.m., jon wrote:

No need for a cone and a pyramid.  A circle and a square will do.

I need to be told how.

Because hulling 2D shapes to get a 3D shape is not possible, I just can't
see a method to achieve the shape directly from a square and a circle.

That is, unless you actually mean a very thin disk and very thin cube.
That is what I originally came up with but am replacing because it was a
little more complex and doesn't produce a geometrically-correct transition.

Thanks,

Steve

On 12/11/2022 5:33 PM, Steve Lelievre wrote:

FYI,

I know that this thread is old now so interest will have waned and the
OP's requirement has been solved ... but I just realized that there is a
better way than I suggested in my original post from weeks ago, for
morphing a tube from having a rectangular end to a circular end (which is
what the OP wanted to do for a fan housing.)

The transition can be achieved, both exactly and code-efficiently, by
hulling a cone and an inverted pyramid. I implemented this solution as the
very small module called morph contained in the code pasted after my
signature (feel free to copy/adapt). To convert the morphed shape to a
hollow tube you either use Minkowski or make slightly oversize version of
the same shape, then subtract the original shape to leave only walls (see
the notes in my code.)

More generally, if you want to morph any polygon to any other polygon,
such as a pentagon to octagon as shown here, you just hull together a cone
and an inverted cone, setting the number of sides required for each cone by
supplying $fn parameters.

Cheers,

Steve

$fn = 60;

module morph(h, d, x, y) {
// Morphs a rectangle to a circle. By Steve Lelievre, 2022.
// h: transition height.
// d: diameter of circular lower end.
// x: x dimension (length) of rectangular upper end.
// y: y dimension (width) of rectangular upper end.
hull() {
resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone
resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, $fn =
4); // inverted pyramid
}
}

// Example usage
translate([-15, 0, 0]) morph(30, 25, 15, 12);

// Code snippet to demonstrate how the morph works
translate([-45, 0, 0]) union() {
color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 =
1);  // cone
color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = 1, r1
= 1, r2 = 0, $fn = 4); // inverted pyramid
color("silver", 0.3) morph(30, 25, 15, 12);
}

// Extending the idea to make a tubular connector:

// Option A. Using Minkowski ensures wall thickness is exactly as
specified when measured in cross section.
// Corners of the rectangular end are rounded accordingly. THe corner
radius is the wall thickness.

module tubeA(h, d, x, y, w) {
// Creates an open tube by Minkowski addition of a sphere to an
internal shape,
// followed by trimming back to height and then subtraction of the
internal shape to hollow out the tube.
// w: wall thickness. This is the thickness in cross section (what
would usually be considered the 'true' value).
// The other parameters are those used in the morph module.

sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // maximum

radius needed for trimming cylinder
difference() {
intersection() {
minkowski() {
morph(h, d, x, y);
sphere(r = w);
}
cylinder(h = h, r = sizeLimit);
}
morph(h, d, x, y);
}
}

translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1);

// Option B. Subtract inner shape from geometrically similar but slightly
larger outer shape.
// Gives square corners to rectangular end.
// !!! However, in some cases, the wall's cross section will be thinner
than this value !!!

module tubeB(h, d, x, y, w) {
// w: wall thickness in horizontal section.
// The other parameters are those used in the morph module.

difference() {
   morph(h, d + 2 * w, x + 2 * w, y + 2 * w);
   morph(h, d, x, y);
}

}

translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1);

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

On 2022-11-13 3:00 p.m., Steve Lelievre wrote:

I'm not entirely clear what shape you're aiming for; is it something like
this? (once adjusted for your exact dimensions)

Steve


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

Well they are cubes and cylinders once extruded. A cone is better because it has one set of edges instead of two sets very close together. The cone could be very short to make it almost flat. On Sun, 11 Dec 2022 at 23:38, Steve Lelievre < steve.lelievre.canada@gmail.com> wrote: > Hi, > > On 2022-12-11 3:04 p.m., jon wrote: > > No need for a cone and a pyramid. A circle and a square will do. > > I need to be told how. > > Because hulling 2D shapes to get a 3D shape is not possible, I just can't > see a method to achieve the shape directly from a square and a circle. > > That is, unless you actually mean a very thin disk and very thin cube. > That is what I originally came up with but am replacing because it was a > little more complex and doesn't produce a geometrically-correct transition. > > Thanks, > > Steve > > > On 12/11/2022 5:33 PM, Steve Lelievre wrote: > > FYI, > > I know that this thread is old now so interest will have waned and the > OP's requirement has been solved ... but I just realized that there is a > better way than I suggested in my original post from weeks ago, for > morphing a tube from having a rectangular end to a circular end (which is > what the OP wanted to do for a fan housing.) > > The transition can be achieved, both exactly and code-efficiently, by > hulling a cone and an inverted pyramid. I implemented this solution as the > very small module called morph contained in the code pasted after my > signature (feel free to copy/adapt). To convert the morphed shape to a > hollow tube you either use Minkowski or make slightly oversize version of > the same shape, then subtract the original shape to leave only walls (see > the notes in my code.) > > > More generally, if you want to morph any polygon to any other polygon, > such as a pentagon to octagon as shown here, you just hull together a cone > and an inverted cone, setting the number of sides required for each cone by > supplying $fn parameters. > > Cheers, > > Steve > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > $fn = 60; > > > module morph(h, d, x, y) { > // Morphs a rectangle to a circle. By Steve Lelievre, 2022. > // h: transition height. > // d: diameter of circular lower end. > // x: x dimension (length) of rectangular upper end. > // y: y dimension (width) of rectangular upper end. > hull() { > resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1); // cone > resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = 0, $fn = > 4); // inverted pyramid > } > } > > // Example usage > translate([-15, 0, 0]) morph(30, 25, 15, 12); > > // Code snippet to demonstrate how the morph works > translate([-45, 0, 0]) union() { > color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = 0, r2 = > 1); // cone > color("green", 0.3) resize([15, 12, 30]) rotate(45) cylinder(h = 1, r1 > = 1, r2 = 0, $fn = 4); // inverted pyramid > color("silver", 0.3) morph(30, 25, 15, 12); > } > > // Extending the idea to make a tubular connector: > > // Option A. Using Minkowski ensures wall thickness is exactly as > specified when measured in cross section. > // Corners of the rectangular end are rounded accordingly. THe corner > radius is the wall thickness. > > module tubeA(h, d, x, y, w) { > // Creates an open tube by Minkowski addition of a sphere to an > internal shape, > // followed by trimming back to height and then subtraction of the > internal shape to hollow out the tube. > // w: wall thickness. This is the thickness in cross section (what > would usually be considered the 'true' value). > // The other parameters are those used in the morph module. > > sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // maximum > radius needed for trimming cylinder > difference() { > intersection() { > minkowski() { > morph(h, d, x, y); > sphere(r = w); > } > cylinder(h = h, r = sizeLimit); > } > morph(h, d, x, y); > } > } > > translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1); > > // Option B. Subtract inner shape from geometrically similar but slightly > larger outer shape. > // Gives square corners to rectangular end. > // !!! However, in some cases, the wall's cross section will be thinner > than this value !!! > > module tubeB(h, d, x, y, w) { > // w: wall thickness in horizontal section. > // The other parameters are those used in the morph module. > > difference() { > morph(h, d + 2 * w, x + 2 * w, y + 2 * w); > morph(h, d, x, y); > } > } > > translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1); > > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > > > On 2022-11-13 3:00 p.m., Steve Lelievre wrote: > > I'm not entirely clear what shape you're aiming for; is it something like > this? (once adjusted for your exact dimensions) > > Steve > > > > > > _______________________________________________ > 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 >
GH
gene heskett
Sun, Dec 11, 2022 11:54 PM

On 12/11/22 18:05, jon wrote:

No need for a cone and a pyramid.  A circle and a square will do.

On 12/11/2022 5:33 PM, Steve Lelievre wrote:

FYI,

I know that this thread is old now so interest will have waned and the
OP's requirement has been solved ... but I just realized that there is
a better way than I suggested in my original post from weeks ago, for
morphing a tube from having a rectangular end to a circular end (which
is what the OP wanted to do for a fan housing.)

So I'll update for the curious.

A "hull" of a circle and a cube subtracted from a 1mm bigger hull is all
I needed, and, since weight of 3d printers hotends determines how fast
you can run them w/o losing home at some point, every gram of weight to
be thrown around has a cost, and the one I wound up using doesn't weigh
in grams, but in grains on my powder scale, 28.9 grains TBE. Might make
a 1% change in a steppers acceleration and therefore the machines
practical top speed.

Cheap,fast,good. Pick any 2. Fast and good isn't going to be cheap.

One of my experiments if I don't fall over first, is to see if I can run
a 3d printer whose electronics have been replaced by Linuxcnc running on
a bpi5 arm based card, with the new stepper/servo's that will not lose
home w/o stopping LinuxCNC in nominally one millisecond. The bpi5 is
about 90 bucks, the drivers and motors are about 75 bucks an axis.
Interface card to link to an spi driver is about 100, or about $420
extra for a smaller corexy machine such as a two trees Saphire5-plus.
Except the target printer here is a tronxy-400-pro whose marlin firmware
is hopelessly broken. It insists on printing everything about 4mm up in
the air. M851 Z-3.9 to adjust that does not exist in that build. The ABL
does work, but with the nozzle that high, why bother wasting the
filament to try?

Cheers, Gene Heskett.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

On 12/11/22 18:05, jon wrote: > No need for a cone and a pyramid.  A circle and a square will do. > > > On 12/11/2022 5:33 PM, Steve Lelievre wrote: >> >> FYI, >> >> I know that this thread is old now so interest will have waned and the >> OP's requirement has been solved ... but I just realized that there is >> a better way than I suggested in my original post from weeks ago, for >> morphing a tube from having a rectangular end to a circular end (which >> is what the OP wanted to do for a fan housing.) So I'll update for the curious. A "hull" of a circle and a cube subtracted from a 1mm bigger hull is all I needed, and, since weight of 3d printers hotends determines how fast you can run them w/o losing home at some point, every gram of weight to be thrown around has a cost, and the one I wound up using doesn't weigh in grams, but in grains on my powder scale, 28.9 grains TBE. Might make a 1% change in a steppers acceleration and therefore the machines practical top speed. Cheap,fast,good. Pick any 2. Fast and good isn't going to be cheap. One of my experiments if I don't fall over first, is to see if I can run a 3d printer whose electronics have been replaced by Linuxcnc running on a bpi5 arm based card, with the new stepper/servo's that will not lose home w/o stopping LinuxCNC in nominally one millisecond. The bpi5 is about 90 bucks, the drivers and motors are about 75 bucks an axis. Interface card to link to an spi driver is about 100, or about $420 extra for a smaller corexy machine such as a two trees Saphire5-plus. Except the target printer here is a tronxy-400-pro whose marlin firmware is hopelessly broken. It insists on printing everything about 4mm up in the air. M851 Z-3.9 to adjust that does not exist in that build. The ABL does work, but with the nozzle that high, why bother wasting the filament to try? Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/>
SL
Steve Lelievre
Mon, Dec 12, 2022 12:27 AM

Hi,

On 2022-12-11 3:45 p.m., nop head wrote:

Well they are cubes and cylinders once extruded.

 A cone is better because it has one set of edges instead of two sets
very close together.

Exactly (and a nice succinct explanation).

The cone could be very short to make it almost flat.

A short cone is fine but I don't think you need it. I have both the
upright cone and the inverted one (the pyramid) set with their heights
equal to the desired height of the final shape and it works just fine.
Doing it that way also avoids the need for a translate to set the height
of the upper surface:  by just using 2 cones of the same height, one
with r1 -= 0 and the other with r2 = 0, you end up with, for example,

hull() {
   cylinder(h = 10, r1 = 0, r2 = 5, $fn = 60);  // cone
   cylinder(h = 10, r1 = 5, r2 = 0, $fn = 4);    // inverted pyramid
}

if you want a rectangle instead of a square, you resize the pyramid in
the x and y dimensions.

Steve

On Sun, 11 Dec 2022 at 23:38, Steve Lelievre
steve.lelievre.canada@gmail.com wrote:

 Hi,

 On 2022-12-11 3:04 p.m., jon wrote:
 No need for a cone and a pyramid.  A circle and a square will do.
 I need to be told how.

 Because hulling 2D shapes to get a 3D shape is not possible, I
 just can't see a method to achieve the shape directly from a
 square and a circle.

 That is, unless you actually mean a very thin disk and very thin
 cube. That is what I originally came up with but am replacing
 because it was a little more complex and doesn't produce a
 geometrically-correct transition.

 Thanks,

 Steve
 On 12/11/2022 5:33 PM, Steve Lelievre wrote:
 FYI,

 I know that this thread is old now so interest will have waned
 and the OP's requirement has been solved ... but I just realized
 that there is a better way than I suggested in my original post
 from weeks ago, for morphing a tube from having a rectangular
 end to a circular end (which is what the OP wanted to do for a
 fan housing.)

 The transition can be achieved, both exactly and
 code-efficiently, by hulling a cone and an inverted pyramid. I
 implemented this solution as the very small module called morph
 contained in the code pasted after my signature (feel free to
 copy/adapt). To convert the morphed shape to a hollow tube you
 either use Minkowski or make slightly oversize version of the
 same shape, then subtract the original shape to leave only walls
 (see the notes in my code.)



 More generally, if you want to morph any polygon to any other
 polygon, such as a pentagon to octagon as shown here, you just
 hull together a cone and an inverted cone, setting the number of
 sides required for each cone by supplying $fn parameters.

 Cheers,

 Steve
 $fn = 60;


 module morph(h, d, x, y) {
    // Morphs a rectangle to a circle. By Steve Lelievre, 2022.
    // h: transition height.
    // d: diameter of circular lower end.
    // x: x dimension (length) of rectangular upper end.
    // y: y dimension (width) of rectangular upper end.
    hull() {
       resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone
       resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 =
 0, $fn = 4); // inverted pyramid
    }
 }

 // Example usage
 translate([-15, 0, 0]) morph(30, 25, 15, 12);

 // Code snippet to demonstrate how the morph works
 translate([-45, 0, 0]) union() {
    color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 =
 0, r2 = 1);  // cone
    color("green", 0.3) resize([15, 12, 30]) rotate(45)
 cylinder(h = 1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid
    color("silver", 0.3) morph(30, 25, 15, 12);
 }

 // Extending the idea to make a tubular connector:

 // Option A. Using Minkowski ensures wall thickness is exactly
 as specified when measured in cross section.
 // Corners of the rectangular end are rounded accordingly. THe
 corner radius is the wall thickness.

 module tubeA(h, d, x, y, w) {
    // Creates an open tube by Minkowski addition of a sphere to
 an internal shape,
    // followed by trimming back to height and then subtraction
 of the internal shape to hollow out the tube.
    // w: wall thickness. This is the thickness in cross section
 (what would usually be considered the 'true' value).
    // The other parameters are those used in the morph module.

    sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); //
 maximum radius needed for trimming cylinder
    difference() {
       intersection() {
          minkowski() {
             morph(h, d, x, y);
             sphere(r = w);
          }
          cylinder(h = h, r = sizeLimit);
       }
       morph(h, d, x, y);
    }
 }

 translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1);

 // Option B. Subtract inner shape from geometrically similar but
 slightly larger outer shape.
 // Gives square corners to rectangular end.
 // !!! However, in some cases, the wall's cross section will be
 thinner than this value !!!

 module tubeB(h, d, x, y, w) {
    // w: wall thickness in horizontal section.
    // The other parameters are those used in the morph module.

    difference() {
       morph(h, d + 2 * w, x + 2 * w, y + 2 * w);
       morph(h, d, x, y);
    }
 }

 translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1);

 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


 On 2022-11-13 3:00 p.m., Steve Lelievre wrote:
 I'm not entirely clear what shape you're aiming for; is it
 something like this? (once adjusted for your exact dimensions)

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

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

Hi, On 2022-12-11 3:45 p.m., nop head wrote: > Well they are cubes and cylinders once extruded. > >  A cone is better because it has one set of edges instead of two sets > very close together. Exactly (and a nice succinct explanation). > The cone could be very short to make it almost flat. A short cone is fine but I don't think you need it. I have both the upright cone and the inverted one (the pyramid) set with their heights equal to the desired height of the final shape and it works just fine. Doing it that way also avoids the need for a translate to set the height of the upper surface:  by just using 2 cones of the same height, one with r1 -= 0 and the other with r2 = 0, you end up with, for example, hull() {    cylinder(h = 10, r1 = 0, r2 = 5, $fn = 60);  // cone    cylinder(h = 10, r1 = 5, r2 = 0, $fn = 4);    // inverted pyramid } if you want a rectangle instead of a square, you resize the pyramid in the x and y dimensions. Steve > > On Sun, 11 Dec 2022 at 23:38, Steve Lelievre > <steve.lelievre.canada@gmail.com> wrote: > > Hi, > > On 2022-12-11 3:04 p.m., jon wrote: >> >> No need for a cone and a pyramid.  A circle and a square will do. >> > I need to be told how. > > Because hulling 2D shapes to get a 3D shape is not possible, I > just can't see a method to achieve the shape directly from a > square and a circle. > > That is, unless you actually mean a very thin disk and very thin > cube. That is what I originally came up with but am replacing > because it was a little more complex and doesn't produce a > geometrically-correct transition. > > Thanks, > > Steve > > >> On 12/11/2022 5:33 PM, Steve Lelievre wrote: >>> >>> FYI, >>> >>> I know that this thread is old now so interest will have waned >>> and the OP's requirement has been solved ... but I just realized >>> that there is a better way than I suggested in my original post >>> from weeks ago, for morphing a tube from having a rectangular >>> end to a circular end (which is what the OP wanted to do for a >>> fan housing.) >>> >>> The transition can be achieved, both exactly and >>> code-efficiently, by hulling a cone and an inverted pyramid. I >>> implemented this solution as the very small module called morph >>> contained in the code pasted after my signature (feel free to >>> copy/adapt). To convert the morphed shape to a hollow tube you >>> either use Minkowski or make slightly oversize version of the >>> same shape, then subtract the original shape to leave only walls >>> (see the notes in my code.) >>> >>> >>> >>> More generally, if you want to morph any polygon to any other >>> polygon, such as a pentagon to octagon as shown here, you just >>> hull together a cone and an inverted cone, setting the number of >>> sides required for each cone by supplying $fn parameters. >>> >>> Cheers, >>> >>> Steve >>> >>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>> >>> $fn = 60; >>> >>> >>> module morph(h, d, x, y) { >>>    // Morphs a rectangle to a circle. By Steve Lelievre, 2022. >>>    // h: transition height. >>>    // d: diameter of circular lower end. >>>    // x: x dimension (length) of rectangular upper end. >>>    // y: y dimension (width) of rectangular upper end. >>>    hull() { >>>       resize([d, d, h]) cylinder(h = 1, r1 = 0, r2 = 1);  // cone >>>       resize([x, y, h]) rotate(45) cylinder(h = 1, r1 = 1, r2 = >>> 0, $fn = 4); // inverted pyramid >>>    } >>> } >>> >>> // Example usage >>> translate([-15, 0, 0]) morph(30, 25, 15, 12); >>> >>> // Code snippet to demonstrate how the morph works >>> translate([-45, 0, 0]) union() { >>>    color("red", 0.3) resize([25, 25, 30]) cylinder(h = 1, r1 = >>> 0, r2 = 1);  // cone >>>    color("green", 0.3) resize([15, 12, 30]) rotate(45) >>> cylinder(h = 1, r1 = 1, r2 = 0, $fn = 4); // inverted pyramid >>>    color("silver", 0.3) morph(30, 25, 15, 12); >>> } >>> >>> // Extending the idea to make a tubular connector: >>> >>> // Option A. Using Minkowski ensures wall thickness is exactly >>> as specified when measured in cross section. >>> // Corners of the rectangular end are rounded accordingly. THe >>> corner radius is the wall thickness. >>> >>> module tubeA(h, d, x, y, w) { >>>    // Creates an open tube by Minkowski addition of a sphere to >>> an internal shape, >>>    // followed by trimming back to height and then subtraction >>> of the internal shape to hollow out the tube. >>>    // w: wall thickness. This is the thickness in cross section >>> (what would usually be considered the 'true' value). >>>    // The other parameters are those used in the morph module. >>> >>>    sizeLimit = max(d / 2 + w, sqrt((x + w)^2 + (y + d)^2)); // >>> maximum radius needed for trimming cylinder >>>    difference() { >>>       intersection() { >>>          minkowski() { >>>             morph(h, d, x, y); >>>             sphere(r = w); >>>          } >>>          cylinder(h = h, r = sizeLimit); >>>       } >>>       morph(h, d, x, y); >>>    } >>> } >>> >>> translate([15, 0, 0]) tubeA(30, 25, 15, 12, 1); >>> >>> // Option B. Subtract inner shape from geometrically similar but >>> slightly larger outer shape. >>> // Gives square corners to rectangular end. >>> // !!! However, in some cases, the wall's cross section will be >>> thinner than this value !!! >>> >>> module tubeB(h, d, x, y, w) { >>>    // w: wall thickness in horizontal section. >>>    // The other parameters are those used in the morph module. >>> >>>    difference() { >>>       morph(h, d + 2 * w, x + 2 * w, y + 2 * w); >>>       morph(h, d, x, y); >>>    } >>> } >>> >>> translate([45, 0, 0]) tubeB(30, 25, 15, 12, 1); >>> >>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>> >>> >>> On 2022-11-13 3:00 p.m., Steve Lelievre wrote: >>>> >>>> I'm not entirely clear what shape you're aiming for; is it >>>> something like this? (once adjusted for your exact dimensions) >>>> >>>> Steve >>>> >>>> >>>> >>>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email todiscuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
GH
gene heskett
Mon, Dec 12, 2022 2:12 AM

On 12/11/22 18:46, nop head wrote:

Well they are cubes and cylinders once extruded.

A cone is better because it has one set of edges instead of two sets very
close together. The cone could be very short to make it almost flat.

Which mucks up higher velocity air flow, it is not w/o viscosity &
results in turbulence losses..

Also, one should recall that in HVAC, its considered that a control
louver is allowing around 50% flow when only open 10 degrees, very
non-linear due to the change in static pressure across the louver at
typical cooling flows. A lesson I learn in controlling a 3 way mixing
setup for a 25kw RCA tv transmitter. I walked in the door to be an
operator in '64, shortly after getting a 1st phone FCC license. The
transmitter had a mixing air flow that opened up the outdoor air when
the tx output air was hot, and recycled the output back to the input
when it was cold, but when the so-called engineers signed off on it, it
was oscillating limit to limit in about a 2 minute wash rinse repeat
cycle, the speed of a honeywell modutrol. So I re-adjusted the modutrols
lever angles on both motors to open starting at tdc on the motors, and
at 90 degrees on the louver levers, so a 45 degree change in the levers
was about a 10% change in the louvers with the other 45 degrees pulling
the louvers wide open. From that day on, transmitter intake air tracked
80F or 5 degrees above outdoor ambient whichever was higher.  We
bypassed some of the hot air to heat the building and I could unlock the
door at 5:55 with the air in the building at about 40F, have the tx on
the air in time for the anthem, and the building up to 65F in that 5
minutes, it settled at 75F or so by 6:05am, and I didn't have to chase
that transmitter the rest of the day.

So. back to my fan rig setup that started this thread. I wound up making
the square front thicker so it was the front of the fan box, resulting
in a 10mm longer funnel from circular input to rectangular thru the
cooling fins on the heat break output. Then I put the fan on the front
of the box, not inside it. But it was still too close to the bed and
sucks in all the hair from the extruder, resulting in the fan getting
blocked, stopping and since it wasn't a prusa which  monitors the tach
signal from the fans, the stopped fan burned up the by then plastic
carriage from the heat conducted up thru the fins to the hot ends
mounting.  Since it was the sucked in trash that killed the fan, it
makes sense to raise the intake away from the bed, and increase the
entry cross section to reduce the velocity of the hoover effect, so the
completed rebuild will have another intake snout on the front of the
fan, raising the lower edge of the intake by 20mm, with an even larger
horn about 25mm deep to further slow the air flow. If that does not stop
the suckage, I'll put some plastic screen wire on that horn with a
couple dabs of superglue so I can see the trash collect and pick it off
on the fly. Combined they might weigh 90 grains.

I fix things...  Couple png's attached.

[...]

Take care & stay well everybody.

Cheers, Gene Heskett.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

On 12/11/22 18:46, nop head wrote: > Well they are cubes and cylinders once extruded. > > A cone is better because it has one set of edges instead of two sets very > close together. The cone could be very short to make it almost flat. > Which mucks up higher velocity air flow, it is not w/o viscosity & results in turbulence losses.. Also, one should recall that in HVAC, its considered that a control louver is allowing around 50% flow when only open 10 degrees, very non-linear due to the change in static pressure across the louver at typical cooling flows. A lesson I learn in controlling a 3 way mixing setup for a 25kw RCA tv transmitter. I walked in the door to be an operator in '64, shortly after getting a 1st phone FCC license. The transmitter had a mixing air flow that opened up the outdoor air when the tx output air was hot, and recycled the output back to the input when it was cold, but when the so-called engineers signed off on it, it was oscillating limit to limit in about a 2 minute wash rinse repeat cycle, the speed of a honeywell modutrol. So I re-adjusted the modutrols lever angles on both motors to open starting at tdc on the motors, and at 90 degrees on the louver levers, so a 45 degree change in the levers was about a 10% change in the louvers with the other 45 degrees pulling the louvers wide open. From that day on, transmitter intake air tracked 80F or 5 degrees above outdoor ambient whichever was higher. We bypassed some of the hot air to heat the building and I could unlock the door at 5:55 with the air in the building at about 40F, have the tx on the air in time for the anthem, and the building up to 65F in that 5 minutes, it settled at 75F or so by 6:05am, and I didn't have to chase that transmitter the rest of the day. So. back to my fan rig setup that started this thread. I wound up making the square front thicker so it was the front of the fan box, resulting in a 10mm longer funnel from circular input to rectangular thru the cooling fins on the heat break output. Then I put the fan on the front of the box, not inside it. But it was still too close to the bed and sucks in all the hair from the extruder, resulting in the fan getting blocked, stopping and since it wasn't a prusa which monitors the tach signal from the fans, the stopped fan burned up the by then plastic carriage from the heat conducted up thru the fins to the hot ends mounting. Since it was the sucked in trash that killed the fan, it makes sense to raise the intake away from the bed, and increase the entry cross section to reduce the velocity of the hoover effect, so the completed rebuild will have another intake snout on the front of the fan, raising the lower edge of the intake by 20mm, with an even larger horn about 25mm deep to further slow the air flow. If that does not stop the suckage, I'll put some plastic screen wire on that horn with a couple dabs of superglue so I can see the trash collect and pick it off on the fly. Combined they might weigh 90 grains. I fix things... Couple png's attached. [...] Take care & stay well everybody. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/>
3
3dcase
Mon, Dec 12, 2022 4:04 AM

I do flat cylinders and flat cubes, maybe rounded for smoothness, for ages.
Advantage is that you can affset them to wherever you want, and the outside edge only intersects the uprights of the cylinder or square when the offset is very extreme. In the cone version this will happen much sooner, depending on the height.
Last one I did was for my father's delta printer conversion. If people are interested I can post the code later today when I am on my computer.
It merges a 5015 fan from a mount into an offset funnel, down into a tube, then merge into a ring made from a rotation-extrude.

And sorry for the syntaxes, I typed this on my tablet and all those code symbols are in weird places.

Sent from Proton Mail mobile

-------- Original Message --------
On 12 Dec 2022, 04:12, gene heskett < gheskett@shentel.net> wrote:

On 12/11/22 18:46, nop head wrote: > Well they are cubes and cylinders once extruded. > > A cone is better because it has one set of edges instead of two sets very > close together. The cone could be very short to make it almost flat. > Which mucks up higher velocity air flow, it is not w/o viscosity & results in turbulence losses.. Also, one should recall that in HVAC, its considered that a control louver is allowing around 50% flow when only open 10 degrees, very non-linear due to the change in static pressure across the louver at typical cooling flows. A lesson I learn in controlling a 3 way mixing setup for a 25kw RCA tv transmitter. I walked in the door to be an operator in '64, shortly after getting a 1st phone FCC license. The transmitter had a mixing air flow that opened up the outdoor air when the tx output air was hot, and recycled the output back to the input when it was cold, but when the so-called engineers signed off on it, it was oscillating limit to limit in about a 2 minute wash rinse repeat cycle, the speed of a honeywell modutrol. So I re-adjusted the modutrols lever angles on both motors to open starting at tdc on the motors, and at 90 degrees on the louver levers, so a 45 degree change in the levers was about a 10% change in the louvers with the other 45 degrees pulling the louvers wide open. From that day on, transmitter intake air tracked 80F or 5 degrees above outdoor ambient whichever was higher. We bypassed some of the hot air to heat the building and I could unlock the door at 5:55 with the air in the building at about 40F, have the tx on the air in time for the anthem, and the building up to 65F in that 5 minutes, it settled at 75F or so by 6:05am, and I didn't have to chase that transmitter the rest of the day. So. back to my fan rig setup that started this thread. I wound up making the square front thicker so it was the front of the fan box, resulting in a 10mm longer funnel from circular input to rectangular thru the cooling fins on the heat break output. Then I put the fan on the front of the box, not inside it. But it was still too close to the bed and sucks in all the hair from the extruder, resulting in the fan getting blocked, stopping and since it wasn't a prusa which monitors the tach signal from the fans, the stopped fan burned up the by then plastic carriage from the heat conducted up thru the fins to the hot ends mounting. Since it was the sucked in trash that killed the fan, it makes sense to raise the intake away from the bed, and increase the entry cross section to reduce the velocity of the hoover effect, so the completed rebuild will have another intake snout on the front of the fan, raising the lower edge of the intake by 20mm, with an even larger horn about 25mm deep to further slow the air flow. If that does not stop the suckage, I'll put some plastic screen wire on that horn with a couple dabs of superglue so I can see the trash collect and pick it off on the fly. Combined they might weigh 90 grains. I fix things... Couple png's attached. [...] Take care & stay well everybody. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page  _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org

I do flat cylinders and flat cubes, maybe rounded for smoothness, for ages. Advantage is that you can affset them to wherever you want, and the outside edge only intersects the uprights of the cylinder or square when the offset is very extreme. In the cone version this will happen much sooner, depending on the height. Last one I did was for my father's delta printer conversion. If people are interested I can post the code later today when I am on my computer. It merges a 5015 fan from a mount into an offset funnel, down into a tube, then merge into a ring made from a rotation-extrude. And sorry for the syntaxes, I typed this on my tablet and all those code symbols are in weird places. Sent from Proton Mail mobile \-------- Original Message -------- On 12 Dec 2022, 04:12, gene heskett < gheskett@shentel.net> wrote: > > On 12/11/22 18:46, nop head wrote: > Well they are cubes and cylinders once extruded. > > A cone is better because it has one set of edges instead of two sets very > close together. The cone could be very short to make it almost flat. > Which mucks up higher velocity air flow, it is not w/o viscosity & results in turbulence losses.. Also, one should recall that in HVAC, its considered that a control louver is allowing around 50% flow when only open 10 degrees, very non-linear due to the change in static pressure across the louver at typical cooling flows. A lesson I learn in controlling a 3 way mixing setup for a 25kw RCA tv transmitter. I walked in the door to be an operator in '64, shortly after getting a 1st phone FCC license. The transmitter had a mixing air flow that opened up the outdoor air when the tx output air was hot, and recycled the output back to the input when it was cold, but when the so-called engineers signed off on it, it was oscillating limit to limit in about a 2 minute wash rinse repeat cycle, the speed of a honeywell modutrol. So I re-adjusted the modutrols lever angles on both motors to open starting at tdc on the motors, and at 90 degrees on the louver levers, so a 45 degree change in the levers was about a 10% change in the louvers with the other 45 degrees pulling the louvers wide open. From that day on, transmitter intake air tracked 80F or 5 degrees above outdoor ambient whichever was higher. We bypassed some of the hot air to heat the building and I could unlock the door at 5:55 with the air in the building at about 40F, have the tx on the air in time for the anthem, and the building up to 65F in that 5 minutes, it settled at 75F or so by 6:05am, and I didn't have to chase that transmitter the rest of the day. So. back to my fan rig setup that started this thread. I wound up making the square front thicker so it was the front of the fan box, resulting in a 10mm longer funnel from circular input to rectangular thru the cooling fins on the heat break output. Then I put the fan on the front of the box, not inside it. But it was still too close to the bed and sucks in all the hair from the extruder, resulting in the fan getting blocked, stopping and since it wasn't a prusa which monitors the tach signal from the fans, the stopped fan burned up the by then plastic carriage from the heat conducted up thru the fins to the hot ends mounting. Since it was the sucked in trash that killed the fan, it makes sense to raise the intake away from the bed, and increase the entry cross section to reduce the velocity of the hoover effect, so the completed rebuild will have another intake snout on the front of the fan, raising the lower edge of the intake by 20mm, with an even larger horn about 25mm deep to further slow the air flow. If that does not stop the suckage, I'll put some plastic screen wire on that horn with a couple dabs of superglue so I can see the trash collect and pick it off on the fly. Combined they might weigh 90 grains. I fix things... Couple png's attached. \[...\] Take care & stay well everybody. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org