discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

making vases, perhaps with InkScape

A
arnholm@arnholm.org
Fri, Feb 16, 2018 1:41 PM

On 2018-02-16 13:47, Troberg wrote:

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.

Yes, I agree this makes sense in many situations.

Carsten Arnholm

On 2018-02-16 13:47, Troberg wrote: > 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. Yes, I agree this makes sense in many situations. Carsten Arnholm
J
jon
Fri, Feb 16, 2018 1:42 PM

I am happy to create a solid vase and then use my 3D printer to only
print the exterior.

On 2/16/2018 5:59 AM, arnholm@arnholm.org wrote:

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


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 am happy to create a solid vase and then use my 3D printer to only print the exterior. On 2/16/2018 5:59 AM, arnholm@arnholm.org wrote: > 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 > > _______________________________________________ > 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.
WA
William Adams
Fri, Feb 16, 2018 1:51 PM

There're tools for getting from Inkscape to OpenSCAD at:
https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD

On Fri, Feb 16, 2018 at 8:42 AM, jon jon@jonbondy.com wrote:

I am happy to create a solid vase and then use my 3D printer to only print
the exterior.

On 2/16/2018 5:59 AM, arnholm@arnholm.org wrote:

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


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.


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

There're tools for getting from Inkscape to OpenSCAD at: https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD On Fri, Feb 16, 2018 at 8:42 AM, jon <jon@jonbondy.com> wrote: > I am happy to create a solid vase and then use my 3D printer to only print > the exterior. > > > > On 2/16/2018 5:59 AM, arnholm@arnholm.org wrote: > >> 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 >> >> _______________________________________________ >> 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. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MK
Marius Kintel
Fri, Feb 16, 2018 2:09 PM

On Feb 16, 2018, at 8:51 AM, William Adams will.adams@frycomm.com wrote:

There're tools for getting from Inkscape to OpenSCAD at: https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD

You can also import SVG directly in the dev snapshot. That needs more users for testing.

-Marius

> On Feb 16, 2018, at 8:51 AM, William Adams <will.adams@frycomm.com> wrote: > > There're tools for getting from Inkscape to OpenSCAD at: https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD > You can also import SVG directly in the dev snapshot. That needs more users for testing. -Marius
P
Parkinbot
Fri, Feb 16, 2018 2:14 PM

Jon,

I think your project is just another example, why a more general interface
for linear_extrude() would make sense. Of course sweep/skin functionality
will also do as it provides the most general interface for extrusions.
To show you some example code I implemented a fast solution on top of my
Naca_sweep library. The general shape results from some fancy vase()
function of z. It uses a translation, a component oriented scaling and some
rotation. You can of course alter it to your needs provided you don't
introduce self-intersection.
vase() is used to define the inner and outer walls. To gain a constant wall
thickness for distorted circles I implemented some sloppy outsetXY()
function which works for well-behaved polygons, but will fail on zaggy
stuff.
The trajectory climbs up the inner wall (starting with index 1 up to N) and
then down the outer wall (ending with index N) and can be fed into a single
sweep() call.

use <Naca_sweep.scad> // https://www.thingiverse.com/thing:900137

$fn=100;
sweep(concat(inner(), outer()));
cube();  // test for manifoldness

function inner(N=100) =
[for(i=[0:N]) vase(i)] ;

function outer(N=100) =
[for(i=[N:-1:1]) outsetXY(vase(i), 2)];

function vase(i) =  //
Rz_(ii/30,    // rotate polygon
(Tz_(pow(i, 2)/100,  // translate polygon
S_(cos(i)+3, sin(4
i)+3,1,  // scale polygon
vec3D(circle())))));    // polygon

function circle(r=10, d = undef, N=$fn?$fn:360/$fa) =
let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_[cos(-360/Ni), sin(-360/N*i)]];

function outsetXY(P, d=10) = [for(i=[0:len(P)-1])
let(p=P[i]-P[(i+1)%len(P)])
let(p_ = p/norm([p.x, p.y]))
P[i]+d*[-p_[1], p_[0], 0] ];

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

Jon, I think your project is just another example, why a more general interface for linear_extrude() would make sense. Of course sweep/skin functionality will also do as it provides the most general interface for extrusions. To show you some example code I implemented a fast solution on top of my Naca_sweep library. The general shape results from some fancy vase() function of z. It uses a translation, a component oriented scaling and some rotation. You can of course alter it to your needs provided you don't introduce self-intersection. vase() is used to define the inner and outer walls. To gain a constant wall thickness for distorted circles I implemented some sloppy outsetXY() function which works for well-behaved polygons, but will fail on zaggy stuff. The trajectory climbs up the inner wall (starting with index 1 up to N) and then down the outer wall (ending with index N) and can be fed into a single sweep() call. use <Naca_sweep.scad> // https://www.thingiverse.com/thing:900137 $fn=100; sweep(concat(inner(), outer())); cube(); // test for manifoldness function inner(N=100) = [for(i=[0:N]) vase(i)] ; function outer(N=100) = [for(i=[N:-1:1]) outsetXY(vase(i), 2)]; function vase(i) = // Rz_(i*i/30, // rotate polygon (Tz_(pow(i, 2)/100, // translate polygon S_(cos(i)+3, sin(4*i)+3,1, // scale polygon vec3D(circle()))))); // polygon function circle(r=10, d = undef, N=$fn?$fn:360/$fa) = let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_*[cos(-360/N*i), sin(-360/N*i)]]; function outsetXY(P, d=10) = [for(i=[0:len(P)-1]) let(p=P[i]-P[(i+1)%len(P)]) let(p_ = p/norm([p.x, p.y])) P[i]+d*[-p_[1], p_[0], 0] ]; -- Sent from: http://forum.openscad.org/
P
Parkinbot
Fri, Feb 16, 2018 2:25 PM

I have to correct my code to better match my explanation. Sorry for that.
renamed outsetXY() into insetXY() as it does an inset, and inner() and
outer() are reversed.

http://forum.openscad.org/file/t887/vase.png

use <Naca_sweep.scad>

$fn=100;
sweep(concat(outer(), inner()));
cube();  // test for manifoldness

function outer(N=100) =
[for(i=[0:N]) vase(i)] ;

function inner(N=100) =
[for(i=[N:-1:1]) insetXY(vase(i), 3)];

function vase(i) =  //
Rz_(ii/30,    // rotate polygon
(Tz_(pow(i, 2)/100,  // translate polygon
S_(cos(i)+3, sin(4
i)+3,1,  // scale polygon
vec3D(circle())))));    // polygon

function circle(r=10, d = undef, N=$fn?$fn:360/$fa) =
let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_[cos(-360/Ni), sin(-360/N*i)]];

function insetXY(P, d=10) = [for(i=[0:len(P)-1])
let(p=P[i]-P[(i+1)%len(P)])
let(p_ = p/norm([p.x, p.y]))
P[i]+d*[-p_[1], p_[0], 0] ];

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

I have to correct my code to better match my explanation. Sorry for that. renamed outsetXY() into insetXY() as it does an inset, and inner() and outer() are reversed. <http://forum.openscad.org/file/t887/vase.png> use <Naca_sweep.scad> $fn=100; sweep(concat(outer(), inner())); cube(); // test for manifoldness function outer(N=100) = [for(i=[0:N]) vase(i)] ; function inner(N=100) = [for(i=[N:-1:1]) insetXY(vase(i), 3)]; function vase(i) = // Rz_(i*i/30, // rotate polygon (Tz_(pow(i, 2)/100, // translate polygon S_(cos(i)+3, sin(4*i)+3,1, // scale polygon vec3D(circle()))))); // polygon function circle(r=10, d = undef, N=$fn?$fn:360/$fa) = let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_*[cos(-360/N*i), sin(-360/N*i)]]; function insetXY(P, d=10) = [for(i=[0:len(P)-1]) let(p=P[i]-P[(i+1)%len(P)]) let(p_ = p/norm([p.x, p.y])) P[i]+d*[-p_[1], p_[0], 0] ]; -- Sent from: http://forum.openscad.org/
J
jon
Fri, Feb 16, 2018 2:28 PM

The terseness of your code always astonishes me.  That said, what is
missing is a way to control the shape easily or intuitively.  I do not
want to  limit my shapes to those that can be calculated with a few
sin/cos variants.  This is why I was heading towards using a series of
smoothed curves to specify scaling, translation, and rotation.  You have
shown how I could use those scaling, translation, and rotation values if
I could calculate them as a function of Z.  What remains is a way to
control these things "easily".  Intuitively?  Quickly?

Note that there is no need to create the walls (create a hollow
container) since I can use a slicer to accomplish that.

Jon

On 2/16/2018 9:14 AM, Parkinbot wrote:

use <Naca_sweep.scad> //https://www.thingiverse.com/thing:900137

$fn=100;
sweep(concat(inner(), outer()));
cube();  // test for manifoldness

function inner(N=100) =
[for(i=[0:N]) vase(i)] ;

function outer(N=100) =
[for(i=[N:-1:1]) outsetXY(vase(i), 2)];

function vase(i) =  //
Rz_(ii/30,    // rotate polygon
(Tz_(pow(i, 2)/100,  // translate polygon
S_(cos(i)+3, sin(4
i)+3,1,  // scale polygon
vec3D(circle())))));    // polygon

function circle(r=10, d = undef, N=$fn?$fn:360/$fa) =
let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_[cos(-360/Ni), sin(-360/N*i)]];

function outsetXY(P, d=10) = [for(i=[0:len(P)-1])
let(p=P[i]-P[(i+1)%len(P)])
let(p_ = p/norm([p.x, p.y]))
P[i]+d*[-p_[1], p_[0], 0] ];

--
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.

The terseness of your code always astonishes me.  That said, what is missing is a way to control the shape easily or intuitively.  I do not want to  limit my shapes to those that can be calculated with a few sin/cos variants.  This is why I was heading towards using a series of smoothed curves to specify scaling, translation, and rotation.  You have shown how I could use those scaling, translation, and rotation values if I could calculate them as a function of Z.  What remains is a way to control these things "easily".  Intuitively?  Quickly? Note that there is no need to create the walls (create a hollow container) since I can use a slicer to accomplish that. Jon On 2/16/2018 9:14 AM, Parkinbot wrote: > use <Naca_sweep.scad> //https://www.thingiverse.com/thing:900137 > > $fn=100; > sweep(concat(inner(), outer())); > cube(); // test for manifoldness > > function inner(N=100) = > [for(i=[0:N]) vase(i)] ; > > function outer(N=100) = > [for(i=[N:-1:1]) outsetXY(vase(i), 2)]; > > function vase(i) = // > Rz_(i*i/30, // rotate polygon > (Tz_(pow(i, 2)/100, // translate polygon > S_(cos(i)+3, sin(4*i)+3,1, // scale polygon > vec3D(circle()))))); // polygon > > function circle(r=10, d = undef, N=$fn?$fn:360/$fa) = > let(r_ = d==undef?r:d/2) [for(i=[0:N-1]) r_*[cos(-360/N*i), sin(-360/N*i)]]; > > function outsetXY(P, d=10) = [for(i=[0:len(P)-1]) > let(p=P[i]-P[(i+1)%len(P)]) > let(p_ = p/norm([p.x, p.y])) > P[i]+d*[-p_[1], p_[0], 0] ]; > -- 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.
P
Parkinbot
Fri, Feb 16, 2018 2:58 PM

As I wrote, it is up to you to define or configure the vase() function to fit
your needs. You can define it piecewise, or use any other given or
user-defined functions and shapes. However, OpenSCAD demands you to use Math
to describe it :-) I guess, this is the non-intuitive part you plan to
avoid. Can't help you there, as it is intuitive for me.

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

As I wrote, it is up to you to define or configure the vase() function to fit your needs. You can define it piecewise, or use any other given or user-defined functions and shapes. However, OpenSCAD demands you to use Math to describe it :-) I guess, this is the non-intuitive part you plan to avoid. Can't help you there, as it is intuitive for me. -- Sent from: http://forum.openscad.org/
J
jon
Fri, Feb 16, 2018 4:04 PM

The SVG would then be used as a shape as part of a design.  I want to
use that SVG (curve) to create a data table to be interpolated to
produce X, Y, length, width, and rotation values (one curve per value). 
I imagine that this would take some work.

:)

On 2/16/2018 9:09 AM, Marius Kintel wrote:

On Feb 16, 2018, at 8:51 AM, William Adams will.adams@frycomm.com wrote:

There're tools for getting from Inkscape to OpenSCAD at: https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD

You can also import SVG directly in the dev snapshot. That needs more users for testing.

-Marius

The SVG would then be used as a shape as part of a design.  I want to use that SVG (curve) to create a data table to be interpolated to produce X, Y, length, width, and rotation values (one curve per value).  I imagine that this would take some work. :) On 2/16/2018 9:09 AM, Marius Kintel wrote: >> On Feb 16, 2018, at 8:51 AM, William Adams <will.adams@frycomm.com> wrote: >> >> There're tools for getting from Inkscape to OpenSCAD at: https://www.shapeoko.com/wiki/index.php/Inkscape#Interface_w.2F_OpenSCAD >> > You can also import SVG directly in the dev snapshot. That needs more users for testing. > > -Marius >
G
Gadgetmind
Fri, Feb 16, 2018 4:48 PM

On 15/02/18 22:03, jon wrote:

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've been designing a load of teapots and using splines to go from a few
control points that I create to something smooth. For the bodies, I
often just change diameter, but for the handles, I place circles in
space and change both size and angle. Changing how elliptical would be
very easy.

See code here for an example.

https://www.thingiverse.com/thing:2590534

Add "HData = HControl; " after the assignment of hdata to see the
control points - I tend to comment such a line in and out when moving
control points to aid placement.

Sorry it's not intuitive and graphical, but I've been happy with the
results.

Links to required libraries are at the top of the file.

On 15/02/18 22:03, jon wrote: > 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've been designing a load of teapots and using splines to go from a few control points that I create to something smooth. For the bodies, I often just change diameter, but for the handles, I place circles in space and change both size and angle. Changing how elliptical would be very easy. See code here for an example. https://www.thingiverse.com/thing:2590534 Add "HData = HControl; " after the assignment of hdata to see the control points - I tend to comment such a line in and out when moving control points to aid placement. Sorry it's not intuitive and graphical, but I've been happy with the results. Links to required libraries are at the top of the file.