discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

making vases, perhaps with InkScape

J
jon
Thu, Feb 15, 2018 10:03 PM

I want to design a series of vases.  Imagine the shape starting at the
bottom as a circle, and as you rise up, the circle gets smaller, then
larger (a neck).  But at some point, the circle becomes an ellipse, and
then the orientation of the ellipse changes.  So, the cross section
changes in radius, and X- and Y- scale as you go up.  So, I need to
specify those three curves in order to specify the vase.

I thought of creating the curves with Bezier curves inside OpenSCAD, but
most implementations are limited to 4 control points; and working in
OpenSCAD by typing in numbers could be both laborious and non-intuitive.

I thought of creating the curves in InkScape, but 1) I'm not sure how to
move them in to OpenSCAD, and B) the whole thing becomes a bit clunky
(modify the curve in InkScape, Copy [or whatever], Paste into OpenSCAD,
F5, rinse, repeat).

Any suggestions about how to create a workflow that is less painful and
[hopefully] intuitive?

I realize that pieces of this have probably been discussed in the past

Jon

--
Sent from my desktop computer.
I do not receive emails while away from my desk,
nor do I receive texts on my main phone number
(which is a land line).
If you know that I am on the road, please text me.
If you know that I am home, please email me.

I want to design a series of vases.  Imagine the shape starting at the bottom as a circle, and as you rise up, the circle gets smaller, then larger (a neck).  But at some point, the circle becomes an ellipse, and then the orientation of the ellipse changes.  So, the cross section changes in radius, and X- and Y- scale as you go up.  So, I need to specify those three curves in order to specify the vase. I thought of creating the curves with Bezier curves inside OpenSCAD, but most implementations are limited to 4 control points; and working in OpenSCAD by typing in numbers could be both laborious and non-intuitive. I thought of creating the curves in InkScape, but 1) I'm not sure how to move them in to OpenSCAD, and B) the whole thing becomes a bit clunky (modify the curve in InkScape, Copy [or whatever], Paste into OpenSCAD, F5, rinse, repeat). Any suggestions about how to create a workflow that is less painful and [hopefully] intuitive? I realize that pieces of this have probably been discussed in the past Jon -- Sent from my desktop computer. I do not receive emails while away from my desk, nor do I receive texts on my main phone number (which is a land line). If you know that I am on the road, please text me. If you know that I am home, please email me.
F
fred_dot_u
Thu, Feb 15, 2018 10:35 PM

How do you feel about creating the curves of the cross section along the
Z-axis and performing a rotate_extrude?

You get the fine detail control of Inkscape and very little code in
OpenSCAD.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Rotate_Extrude

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

How do you feel about creating the curves of the cross section along the Z-axis and performing a rotate_extrude? You get the fine detail control of Inkscape and very little code in OpenSCAD. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Rotate_Extrude -- Sent from: http://forum.openscad.org/
J
jon
Fri, Feb 16, 2018 2:29 AM

This is the kind of shape I want to make, only with better control over
the shape  It starts out symmetrical, but then the cross section changes
from circular to elliptical.  Not very compelling at the moment.  I want
to be able to draw a curve for the diameter, x scale, and y scale as a
function of z.  And then, of course, I will want curves for x and y
translation.  It never ends.

inches = 25.4;
$fn = 200;

module Crosssections(i) {
    if (i < 90)
        // base and neck
        translate([0, 0, i])
            cylinder(h = 0.1, d = (3 * cos(4*i) + 6) * inches);
    else if (i <= 180)
        // transition to ellipse
        translate([0, 0, i])
            scale([1, 90 / i, 1])
                cylinder(h = 0.1, d = 9 * inches);
    else if (i < 360)
        // transition to other ellipse
        translate([0, 0, i])
            scale([360 / (2 * i), (180 + i) / 720, 1])
                cylinder(h = 0.1, d = 9 * inches);
    }

for (i = [1:360])
    hull() {
        Crosssections(i);
        Crosssections(i+1);
        }

On 2/15/2018 5:03 PM, jon wrote:

I want to design a series of vases.  Imagine the shape starting at the
bottom as a circle, and as you rise up, the circle gets smaller, then
larger (a neck).  But at some point, the circle becomes an ellipse,
and then the orientation of the ellipse changes.  So, the cross
section changes in radius, and X- and Y- scale as you go up.  So, I
need to specify those three curves in order to specify the vase.

I thought of creating the curves with Bezier curves inside OpenSCAD,
but most implementations are limited to 4 control points; and working
in OpenSCAD by typing in numbers could be both laborious and
non-intuitive.

I thought of creating the curves in InkScape, but 1) I'm not sure how
to move them in to OpenSCAD, and B) the whole thing becomes a bit
clunky (modify the curve in InkScape, Copy [or whatever], Paste into
OpenSCAD, F5, rinse, repeat).

Any suggestions about how to create a workflow that is less painful
and [hopefully] intuitive?

I realize that pieces of this have probably been discussed in the past

Jon

--
Sent from my desktop computer.
I do not receive emails while away from my desk,
nor do I receive texts on my main phone number
(which is a land line).
If you know that I am on the road, please text me.
If you know that I am home, please email me.

This is the kind of shape I want to make, only with better control over the shape  It starts out symmetrical, but then the cross section changes from circular to elliptical.  Not very compelling at the moment.  I want to be able to draw a curve for the diameter, x scale, and y scale as a function of z.  And then, of course, I will want curves for x and y translation.  It never ends. inches = 25.4; $fn = 200; module Crosssections(i) {     if (i < 90)         // base and neck         translate([0, 0, i])             cylinder(h = 0.1, d = (3 * cos(4*i) + 6) * inches);     else if (i <= 180)         // transition to ellipse         translate([0, 0, i])             scale([1, 90 / i, 1])                 cylinder(h = 0.1, d = 9 * inches);     else if (i < 360)         // transition to other ellipse         translate([0, 0, i])             scale([360 / (2 * i), (180 + i) / 720, 1])                 cylinder(h = 0.1, d = 9 * inches);     } for (i = [1:360])     hull() {         Crosssections(i);         Crosssections(i+1);         } On 2/15/2018 5:03 PM, jon wrote: > I want to design a series of vases.  Imagine the shape starting at the > bottom as a circle, and as you rise up, the circle gets smaller, then > larger (a neck).  But at some point, the circle becomes an ellipse, > and then the orientation of the ellipse changes.  So, the cross > section changes in radius, and X- and Y- scale as you go up.  So, I > need to specify those three curves in order to specify the vase. > > I thought of creating the curves with Bezier curves inside OpenSCAD, > but most implementations are limited to 4 control points; and working > in OpenSCAD by typing in numbers could be both laborious and > non-intuitive. > > I thought of creating the curves in InkScape, but 1) I'm not sure how > to move them in to OpenSCAD, and B) the whole thing becomes a bit > clunky (modify the curve in InkScape, Copy [or whatever], Paste into > OpenSCAD, F5, rinse, repeat). > > Any suggestions about how to create a workflow that is less painful > and [hopefully] intuitive? > > I realize that pieces of this have probably been discussed in the past > > Jon > -- Sent from my desktop computer. I do not receive emails while away from my desk, nor do I receive texts on my main phone number (which is a land line). If you know that I am on the road, please text me. If you know that I am home, please email me.
MK
Marius Kintel
Fri, Feb 16, 2018 5:27 AM

Hi Jon,

I did this a while back by stacking a bunch of linear_extrude() segments:
The $t stuff was to play with animations to discover fun variants.

SLABS = 30;
HEIGHT = 80;
TWIST = 90sin(2$t360+90);
FREQ=180 + 360
$t;
START=200+4360$t;
SCALE=0.3;
IDX=2;

slab(HEIGHT/SLABS, 0, TWIST/SLABS, scale(0), scale(1/SLABS)) cross();
for (i = [0:SLABS-1]) {
translate([0,0,iHEIGHT/SLABS]) {
slab(HEIGHT/SLABS, i
TWIST/SLABS, (i+1)*TWIST/SLABS,
scale(i/SLABS), scale((i+1)/SLABS)) slice();
}
}

module cross() {
minkowski() {
circle(r=3, $fn=16);
union() {
square([10,20], center=true);
square([20,10], center=true);
}
}
}

module slab(h, rot_from, rot_to, scale_from, scale_to) {
linear_extrude(height=h, twist=rot_to-rot_from, scale=scale_to/scale_from) {
rotate(-rot_from)
scale(scale_from)
children();
}
}

function scale(t) = 1+SCALE*(sin(t*FREQ + START)+1);

module slice() {
difference() {
cross();
offset(-1) cross();
}
}

Hi Jon, I did this a while back by stacking a bunch of linear_extrude() segments: The $t stuff was to play with animations to discover fun variants. SLABS = 30; HEIGHT = 80; TWIST = 90*sin(2*$t*360+90); FREQ=180 + 360*$t; START=200+4*360*$t; SCALE=0.3; IDX=2; slab(HEIGHT/SLABS, 0, TWIST/SLABS, scale(0), scale(1/SLABS)) cross(); for (i = [0:SLABS-1]) { translate([0,0,i*HEIGHT/SLABS]) { slab(HEIGHT/SLABS, i*TWIST/SLABS, (i+1)*TWIST/SLABS, scale(i/SLABS), scale((i+1)/SLABS)) slice(); } } module cross() { minkowski() { circle(r=3, $fn=16); union() { square([10,20], center=true); square([20,10], center=true); } } } module slab(h, rot_from, rot_to, scale_from, scale_to) { linear_extrude(height=h, twist=rot_to-rot_from, scale=scale_to/scale_from) { rotate(-rot_from) scale(scale_from) children(); } } function scale(t) = 1+SCALE*(sin(t*FREQ + START)+1); module slice() { difference() { cross(); offset(-1) cross(); } }
T
Troberg
Fri, Feb 16, 2018 9:03 AM

Another way of doing it is stacking cross sections, and then hulling an
unioning them in sequence.

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

Another way of doing it is stacking cross sections, and then hulling an unioning them in sequence. -- Sent from: http://forum.openscad.org/
CC
Chris Camacho
Fri, Feb 16, 2018 10:05 AM

  $fn = 200;

I've never needed such a high setting (especially while developing!)

indeed some of my best pen pots relied on $fn being so small that the
triangulation was a feature of the design...

adding a twist to linear_extrude can make some great effects....

>  $fn = 200; I've never needed such a high setting (especially while developing!) indeed some of my best pen pots relied on $fn being so small that the triangulation was a feature of the design... adding a twist to linear_extrude can make some great effects....
A
arnholm@arnholm.org
Fri, Feb 16, 2018 10:59 AM

On 2018-02-16 10:03, Troberg wrote:

Another way of doing it is stacking cross sections, and then hulling an
unioning them in sequence.

This will only work if the cross sections are solid, without holes. For
the typical vase it will not be the case, unless you are ok with
creating 2 with slightly different X/Y scaling and subtract one from the
other.

Carsten Arnholm

On 2018-02-16 10:03, Troberg wrote: > Another way of doing it is stacking cross sections, and then hulling an > unioning them in sequence. This will only work if the cross sections are solid, without holes. For the typical vase it will not be the case, unless you are ok with creating 2 with slightly different X/Y scaling and subtract one from the other. Carsten Arnholm
J
jon
Fri, Feb 16, 2018 12:24 PM

I agree.  My effort is towards allowing me to specify the cross sections
in a manner that is efficient and intuitive, rather than laborious and
obscure.

On 2/16/2018 4:03 AM, Troberg wrote:

Another way of doing it is stacking cross sections, and then hulling an
unioning them in sequence.

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


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

--
Sent from my desktop computer.
I do not receive emails while away from my desk,
nor do I receive texts on my main phone number
(which is a land line).
If you know that I am on the road, please text me.
If you know that I am home, please email me.

I agree.  My effort is towards allowing me to specify the cross sections in a manner that is efficient and intuitive, rather than laborious and obscure. On 2/16/2018 4:03 AM, Troberg wrote: > Another way of doing it is stacking cross sections, and then hulling an > unioning them in sequence. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > -- Sent from my desktop computer. I do not receive emails while away from my desk, nor do I receive texts on my main phone number (which is a land line). If you know that I am on the road, please text me. If you know that I am home, please email me.
RP
Ronaldo Persiano
Fri, Feb 16, 2018 12:29 PM

You may consider using Bezier subdivision as expressed in [1]. That was in
principle to generate points in a cubic Bezier curve defined by 4 control
points but may be used in a more general setting. If you feed subdivb3()
with more than 4 control points,  it will generate points of all cubic
Bezier arcs defined by

p[3j]... p[3(j+1)] for some integer j

To get smooth transition between arcs you will need some conditions on the
control points:

p[3j] is in the segment with extremes
p[3
j-1] p[3*j+1] for all j>0

An easy way to satisfy this condition is to choose:

p[3j] = ( p[3j-1] + p[3*j+1] )  / 2

In subdivb3, n is the depth of recursion and should be a low integer.

[1] http://forum.openscad.org/OpenSCAD-programming-question-
recursion-functions-and-modules-tp23197p23217.html

Em 15 de fev de 2018 8:04 PM, "jon" jon@jonbondy.com escreveu:

I thought of creating the curves with Bezier curves inside OpenSCAD, but
most implementations are limited to 4 control points; and working in
OpenSCAD by typing in numbers could be both laborious and non-intuitive.

You may consider using Bezier subdivision as expressed in [1]. That was in principle to generate points in a cubic Bezier curve defined by 4 control points but may be used in a more general setting. If you feed subdivb3() with more than 4 control points, it will generate points of all cubic Bezier arcs defined by p[3*j]... p[3*(j+1)] for some integer j To get smooth transition between arcs you will need some conditions on the control points: p[3*j] is in the segment with extremes p[3*j-1] p[3*j+1] for all j>0 An easy way to satisfy this condition is to choose: p[3*j] = ( p[3*j-1] + p[3*j+1] ) / 2 In subdivb3, n is the depth of recursion and should be a low integer. [1] http://forum.openscad.org/OpenSCAD-programming-question- recursion-functions-and-modules-tp23197p23217.html Em 15 de fev de 2018 8:04 PM, "jon" <jon@jonbondy.com> escreveu: I thought of creating the curves with Bezier curves inside OpenSCAD, but most implementations are limited to 4 control points; and working in OpenSCAD by typing in numbers could be both laborious and non-intuitive.
T
Troberg
Fri, Feb 16, 2018 12:47 PM

This will only work if the cross sections are solid, without holes. For
the typical vase it will not be the case, unless you are ok with
creating 2 with slightly different X/Y scaling and subtract one from the
other.

How I've done similar tasks:

  • Have all the cross sections and make a solid shape by hulling and
    unioning.

  • Then, take each cross section (except the first, if you want a bottom), do
    a negative offset on each, hull and union.

  • Make a difference between the first object and the second object.

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

> This will only work if the cross sections are solid, without holes. For > the typical vase it will not be the case, unless you are ok with > creating 2 with slightly different X/Y scaling and subtract one from the > other. How I've done similar tasks: * Have all the cross sections and make a solid shape by hulling and unioning. * Then, take each cross section (except the first, if you want a bottom), do a negative offset on each, hull and union. * Make a difference between the first object and the second object. -- Sent from: http://forum.openscad.org/