# making vases, perhaps with InkScape

50 messages
123
Open this post in threaded view
|

## making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 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/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 Administrator In reply to this post by jon_bondy 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();   } } _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by fred_dot_u 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 [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by jon_bondy  >  \$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.... _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by Troberg 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 [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by fred_dot_u 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 jTo 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>0An easy way to satisfy this condition is to choose:p[3*j] = ( p[3*j-1] + p[3*j+1] )  / 2In 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.htmlEm 15 de fev de 2018 8:04 PM, "jon" <[hidden email]> 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. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by cacb > 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/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 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 _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 Administrator > On Feb 16, 2018, at 8:51 AM, William Adams <[hidden email]> 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 _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by jon_bondy 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 // 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/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 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. use \$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/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 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/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: making vases, perhaps with InkScape

 In reply to this post by kintel 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 <[hidden email]> 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 > _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org