# bend a pipe/tube

14 messages
Open this post in threaded view
|

## bend a pipe/tube

 This post was updated on . CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|

## Re: bend a pipe/tube

Open this post in threaded view
|

## Re: bend a pipe/tube

 CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|

## Re: bend a pipe/tube

 On Wed, Apr 29, 2015 at 01:32:58AM -0700, biskero wrote: > Ciao, > > thanks for the link. > Any suggestions on which function would apply to my case? > I am kind of new to openscad and it will help me a lot. sweep(), basically. sweep() has this signature:     sweep(shape, path_transforms, closed=false); shape is a list of 2D coordinates in a specific order. You can generate these by using one of the functions in . These coordinates can also be fed into polygon() to see what kind of shape you're getting. path_transforms is a list of 4x4 matrix transformations that are applied using multmatrix. Again, you can generate these individual transformations from functions in . Each of these transformations are applied to the coordinates in shape to get their current position, and then joined to their previous operation. Transformations from are basically functions (translation, rotation, and scaling) that are analogous to the standard rotate(), translate() and scale() operations in OpenSCAD. These all generate 4x4 matrices representing the operation. These matrices can be multiplied together to combine them in a similar order to how OpenSCAD works. closed is a boolean value defining whether or not you want your shape to be a closed loop. A rubber band is a closed loop, a string is open-ended. Here's an example:    sweep (circle (10, \$fn = 20), [translation ([0, 0, 0]), translation ([0, 0, 20])]); which is equivalent to:    linear_extrude (height = 20)    circle (r = 10, \$fn = 20); or    hull () {        translate ([0, 0, 0])        cylinder (r = 10, h = 0, \$fn = 20);        translate ([0, 0, 20])        cylinder (r = 10, h = 0, \$fn = 20);    } Note that the last implementation won't actually work because you can't have a cylinder with 0 height, but that's essentially what a circle is. -- Kind regards, Loong Jin _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org signature.asc (836 bytes) Download Attachment
Open this post in threaded view
|

## Re: bend a pipe/tube

Open this post in threaded view
|

## Re: bend a pipe/tube

 CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|

## Re: bend a pipe/tube

 Administrator On Apr 29, 2015, at 05:57 AM, biskero <[hidden email]> wrote: > But I wanted to do it with a cylinder (in my case is a tube of oval section) > and apply a curve/bend at certain point to have one section straight and > rest shaped with that curve/bend. > There was a very similar feature request for this a while back: https://github.com/openscad/openscad/issues/815This is not something we’re working on right now, but if you have any ideas to contribute to that discussion, it would help us deciding exactly what features are needed when we eventually decide to implement it. The alternative right now is to start from 2D. The toothed belt example provides an easy mechanism for describing paths: https://github.com/openscad/list-comprehension-demos#toothed-beltscadIf you decide to go that way, it would be very helpful if you could describe what you’re doing and why - that would help us create better helper tools for allowing people to design similar objects. ..and even include a demo based on your work and experiences.  -Marius _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: bend a pipe/tube

 CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|

## Re: bend a pipe/tube

 CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|

## Re: bend a pipe/tube

 Administrator On Apr 29, 2015, at 10:50 AM, biskero <[hidden email]> wrote: > > here is code I found to create a ellipse tube based on torus, but it's > pretty slow when I compile it into my design, OpenSCAD starts thinking!!! :) > Any suggestion how to speed this code? > The final render takes about 10 seconds. That’s normal, and you only do that once you’re done and want to export and STL. Previews should be instantaneous.  -Marius _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: bend a pipe/tube

 In reply to this post by kintel On Wed, Apr 29, 2015 at 10:31:56AM -0400, Marius Kintel wrote: > On Apr 29, 2015, at 05:57 AM, biskero <[hidden email]> wrote: > > > But I wanted to do it with a cylinder (in my case is a tube of oval section) > > and apply a curve/bend at certain point to have one section straight and > > rest shaped with that curve/bend. > > > There was a very similar feature request for this a while back: > https://github.com/openscad/openscad/issues/815I've recently done something similar, in my case I've used the combination of cube and (difference of) cylinder to create a small skeleton outline, and then use minkowski with a sphere on this skeleton. The cross-section of the resulting object isn't perfectly round (but the smaller the skeleton is compared to the sphere this doesn't matter). This gets painfully slow on rendering, though (but I've probably used too many faces). In my case I've computed the difference of two such objects (with the second one translated). The resulting STL is here: http://project.runtux.com/lawnmowerpart.stlthe OpenSCAD code is on github: https://github.com/rsc3d/rsc3d/blob/master/lawnmowerpart.scadThe relevant code is in the module "bow" (and "bows" to compute the difference). Ralf -- Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16 Open Source Consulting                  www:   http://www.runtux.comReichergasse 131, A-3411 Weidling       email: [hidden email] allmenda.com member                     email: [hidden email] _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: bend a pipe/tube

 In reply to this post by biskero On Wed, Apr 29, 2015 at 07:50:34AM -0700, biskero wrote: > Ciao, > > > here is code I found to create a ellipse tube based on torus, but it's > pretty slow when I compile it into my design, OpenSCAD starts thinking!!! :) > Any suggestion how to speed this code? > > translate([0,0,-r2-1]) > linear_extrude(height=2*r2+2) >         polygon([ >            [0,0], >            [trx * cos(a0), try * sin(a0)], >            [trx * cos(a1), try * sin(a1)], >            [trx * cos(a2), try * sin(a2)], >            [trx * cos(a3), try * sin(a3)], >            [trx * cos(a4), try * sin(a4)], >            [0,0] >       ]); This bit can be done using pieSlice() from MCAD. -- Kind regards, Loong Jin _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org signature.asc (836 bytes) Download Attachment