I have a model I've constructed using a series of translates, hulls,
linear_extrudes, and imports.
I want to flare the bottom out so it is wider than it will be
proportionally wider (in X and Y) than it is now but so that the top will
remain the same size.
Is there a way to do this? Possibly with multimatrix?
Yes, I can rescale the import, but I'd have to recalculate a bunch of stuff.
If you want to scale your model only in XY, say by .9 leaving Z as it is, you
can use
scale([.9, .9, 1]) model();
but there is no conic (or even more general nonlinear) transformation in
OpenSCAD that will map a cylindric object into a truncated cone object or
similar.
However you can extrude an object into a truncated cone object, e.g. by
using
linear_extrude(height = 10, scale = 0.9) myModel2D();
module myModel2D() circle(10);
--
Sent from: http://forum.openscad.org/
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc). All
it really lets you do is apply multiple transformations at once, which, if
you ask me, only serves to obscure the programmer's intentions. Look into
Affine transformations if you'd like more information.
If Parkinbot's suggeston doesn't work for your particular use case (and it
sounds like you're stuck in 3D since you're using import()), you might try
cutting your model into pieces by sweeping across it with a thin cube(),
and then scaling these pieces & union()'ing them together. It'll be tricky,
and you'll have to be careful so as not to create zero-width gaps, but
Something to the effect of:
function f(h) = ...some function defining your flare (reciprocal function
perhaps)...
for (i=[0:depth:myModelHeight/depth]) {
scale([f(i), f(i), 1]) intersection() {
translate([0, 0, i]) cube([modelX, modelY, depth]);
myModel();
}
}
Note this psuedocode doesn't account for zero-width gaps. Depending on the
geometry of your model you may have to create small extrusions that join
each section together to prevent ZWGs. Another approach might be to sweep
the cube() up your model, use projection() to turn that section into 2D,
and then use Parkinbot's approach.
Cheers,
Max
On Sun, Dec 15, 2019 at 5:38 AM Parkinbot rudolf@digitaldocument.de wrote:
If you want to scale your model only in XY, say by .9 leaving Z as it is,
you
can use
scale([.9, .9, 1]) model();
but there is no conic (or even more general nonlinear) transformation in
OpenSCAD that will map a cylindric object into a truncated cone object or
similar.
However you can extrude an object into a truncated cone object, e.g. by
using
linear_extrude(height = 10, scale = 0.9) myModel2D();
module myModel2D() circle(10);
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
*but it should work.
On Sun, Dec 15, 2019 at 3:23 PM Max Bond max.o.bond@gmail.com wrote:
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc). All
it really lets you do is apply multiple transformations at once, which, if
you ask me, only serves to obscure the programmer's intentions. Look into
Affine transformations if you'd like more information.
If Parkinbot's suggeston doesn't work for your particular use case (and it
sounds like you're stuck in 3D since you're using import()), you might try
cutting your model into pieces by sweeping across it with a thin cube(),
and then scaling these pieces & union()'ing them together. It'll be tricky,
and you'll have to be careful so as not to create zero-width gaps, but
Something to the effect of:
function f(h) = ...some function defining your flare (reciprocal function
perhaps)...
for (i=[0:depth:myModelHeight/depth]) {
scale([f(i), f(i), 1]) intersection() {
translate([0, 0, i]) cube([modelX, modelY, depth]);
myModel();
}
}
Note this psuedocode doesn't account for zero-width gaps. Depending on the
geometry of your model you may have to create small extrusions that join
each section together to prevent ZWGs. Another approach might be to sweep
the cube() up your model, use projection() to turn that section into 2D,
and then use Parkinbot's approach.
Cheers,
Max
On Sun, Dec 15, 2019 at 5:38 AM Parkinbot rudolf@digitaldocument.de
wrote:
If you want to scale your model only in XY, say by .9 leaving Z as it is,
you
can use
scale([.9, .9, 1]) model();
but there is no conic (or even more general nonlinear) transformation in
OpenSCAD that will map a cylindric object into a truncated cone object or
similar.
However you can extrude an object into a truncated cone object, e.g. by
using
linear_extrude(height = 10, scale = 0.9) myModel2D();
module myModel2D() circle(10);
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Hi Bryan,
I got nerdsniped by this problem and had a pleasant Sunday evening writing
a solution to it.
The code needs to be cleaned up, it's slow (because it uses resize()), and
I haven't tested it on complex models yet, but it should do what you want
it to do.
I'm goin
On Sun, Dec 15, 2019 at 3:24 PM Max Bond max.o.bond@gmail.com wrote:
*but it should work.
On Sun, Dec 15, 2019 at 3:23 PM Max Bond max.o.bond@gmail.com wrote:
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc). All
it really lets you do is apply multiple transformations at once, which, if
you ask me, only serves to obscure the programmer's intentions. Look into
Affine transformations if you'd like more information.
If Parkinbot's suggeston doesn't work for your particular use case (and
it sounds like you're stuck in 3D since you're using import()), you might
try cutting your model into pieces by sweeping across it with a thin
cube(), and then scaling these pieces & union()'ing them together. It'll be
tricky, and you'll have to be careful so as not to create zero-width gaps,
but
Something to the effect of:
function f(h) = ...some function defining your flare (reciprocal function
perhaps)...
for (i=[0:depth:myModelHeight/depth]) {
scale([f(i), f(i), 1]) intersection() {
translate([0, 0, i]) cube([modelX, modelY, depth]);
myModel();
}
}
Note this psuedocode doesn't account for zero-width gaps. Depending on
the geometry of your model you may have to create small extrusions that
join each section together to prevent ZWGs. Another approach might be to
sweep the cube() up your model, use projection() to turn that section into
2D, and then use Parkinbot's approach.
Cheers,
Max
On Sun, Dec 15, 2019 at 5:38 AM Parkinbot rudolf@digitaldocument.de
wrote:
If you want to scale your model only in XY, say by .9 leaving Z as it
is, you
can use
scale([.9, .9, 1]) model();
but there is no conic (or even more general nonlinear) transformation in
OpenSCAD that will map a cylindric object into a truncated cone object or
similar.
However you can extrude an object into a truncated cone object, e.g. by
using
linear_extrude(height = 10, scale = 0.9) myModel2D();
module myModel2D() circle(10);
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Oops, I accidentally hit send.
I'm going to clean this code up & release it on GitHub, and I haven't
decided on a license yet, but this draft is licensed CC0 & you can use it
in your project if you wish. Attribution would be nice but isn't strictly
necessary.
The module assumes that your model is centred at the origin. It sweeps down
the object, starting from the top, and takes a 2D slice, which it scales to
a particular size. You'll need to write a function that maps the height to
a vector with the size of the 2D bounding box at that height (e.g.
[[height1, [x1, y1,], [height2, [x2, y2]]...] ). You'll want to play with
different values of precision as well. Lower values = more precise.
In the code is a simple example which turns a cylinder into an exponential
flare.
As I said, I haven't tested it extensively, but it appears to be outputting
manifold models.
Cheers,
Max
On Sun, Dec 15, 2019 at 7:57 PM Max Bond max.o.bond@gmail.com wrote:
Hi Bryan,
I got nerdsniped by this problem and had a pleasant Sunday evening writing
a solution to it.
The code needs to be cleaned up, it's slow (because it uses resize()), and
I haven't tested it on complex models yet, but it should do what you want
it to do.
I'm goin
On Sun, Dec 15, 2019 at 3:24 PM Max Bond max.o.bond@gmail.com wrote:
*but it should work.
On Sun, Dec 15, 2019 at 3:23 PM Max Bond max.o.bond@gmail.com wrote:
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc). All
it really lets you do is apply multiple transformations at once, which, if
you ask me, only serves to obscure the programmer's intentions. Look into
Affine transformations if you'd like more information.
If Parkinbot's suggeston doesn't work for your particular use case (and
it sounds like you're stuck in 3D since you're using import()), you might
try cutting your model into pieces by sweeping across it with a thin
cube(), and then scaling these pieces & union()'ing them together. It'll be
tricky, and you'll have to be careful so as not to create zero-width gaps,
but
Something to the effect of:
function f(h) = ...some function defining your flare (reciprocal
function perhaps)...
for (i=[0:depth:myModelHeight/depth]) {
scale([f(i), f(i), 1]) intersection() {
translate([0, 0, i]) cube([modelX, modelY, depth]);
myModel();
}
}
Note this psuedocode doesn't account for zero-width gaps. Depending on
the geometry of your model you may have to create small extrusions that
join each section together to prevent ZWGs. Another approach might be to
sweep the cube() up your model, use projection() to turn that section into
2D, and then use Parkinbot's approach.
Cheers,
Max
On Sun, Dec 15, 2019 at 5:38 AM Parkinbot rudolf@digitaldocument.de
wrote:
If you want to scale your model only in XY, say by .9 leaving Z as it
is, you
can use
scale([.9, .9, 1]) model();
but there is no conic (or even more general nonlinear) transformation in
OpenSCAD that will map a cylindric object into a truncated cone object
or
similar.
However you can extrude an object into a truncated cone object, e.g. by
using
linear_extrude(height = 10, scale = 0.9) myModel2D();
module myModel2D() circle(10);
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On Sun, Dec 15, 2019 at 4:24 PM Max Bond max.o.bond@gmail.com wrote:
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc).
Mostly true, (and I realize this doesn't help for the original question)
but I gotta point out that shear/skew transformations are currently only
possible using multmatrix().
On 15 Dec 2019 at 19:57, Max Bond wrote:
Hi Bryan,
I got nerdsniped by this problem and had a pleasant Sunday evening writing a solution to it.
Hah! I never heard that word before, but it is SO apt. I get nerdsniped all the time. Just this
afternoon I ended up writing a long tutorial on some operations in Inkscape. Yesterday it was
a problem on an Arduino running a WiFi module.
Thanks for the chuckle!
On Sun, Dec 15, 2019 at 10:07 PM Hans L thehans@gmail.com wrote:
On Sun, Dec 15, 2019 at 4:24 PM Max Bond max.o.bond@gmail.com wrote:
There's nothing you can do with multmatrix() that you can't do with a
series of other transformations (rotate(), translate(), scale(), etc).
Mostly true, (and I realize this doesn't help for the original question)
but I gotta point out that shear/skew transformations are currently only
possible using multmatrix().
Good point, I hadn't thought of that.
On Sun, Dec 15, 2019 at 10:11 PM lar3ry@sasktel.net wrote:
On 15 Dec 2019 at 19:57, Max Bond wrote:
Hi Bryan,
I got nerdsniped by this problem and had a pleasant Sunday evening
writing a solution to it.
Hah! I never heard that word before, but it is SO apt. I get nerdsniped
all the time. Just this
afternoon I ended up writing a long tutorial on some operations in
Inkscape. Yesterday it was
a problem on an Arduino running a WiFi module.
Thanks for the chuckle!
Anytime :) Here's another https://www.xkcd.com/356/