discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Fitting a curve to points

D
Dylan
Sun, Jul 27, 2025 2:35 PM

That limited number of measurements is due to being at the experimental
stage - if necessary, there could be many more reference points.
Your screenshots indeed show what I am trying to achieve, but HOW did
you do it?
D

On 27/07/2025 15:31, Sanjeev Prabhakar via Discuss wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you shared is
correct.
Screenshot 2025-07-27 at 7.53.59 PM.png
Screenshot 2025-07-27 at 7.59.00 PM.png

On Sun, 27 Jul, 2025, 7:10 pm Dylan via Discuss,
<discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

 Example measures (in mm) for a theoretical instrument:

 [[0, 50], [5, 55], [10, 50], [50, 20]]

 In reality, the full length would be at least 500mm and there may be 20
 or more measures.

 On 27/07/2025 14:20, Sanjeev Prabhakar via Discuss wrote:

Can you share the list of coordinates

On Sun, 27 Jul, 2025, 6:38 pm Dylan via Discuss,
<discuss@lists.openscad.org mailto:discuss@lists.openscad.org

 <mailto:discuss@lists.openscad.org
 <mailto:discuss@lists.openscad.org>>> wrote:

     I need to model musical instruments which are, basically,

 flared tubes.

     The attached image shows examples (these are shawms, and each

 is two

     pieces: the main body of the instrument and a small insert

 which holds

     the reed - I'm focusing on the main body.)
     I have a list of measurements which are each [distance-from-end,
     diameter]; effectively [x,y] or [x,z] coordinates.
     Is there a way to generate a curve which passes through each
     measurement
     point? I have looked into bézier curves (which is how I would

 approach

     this in Blender) but they don't seem to function the same way

 as the

     curve does not pass through the given points.
     Secondly, once such a curve is generated, how would I generate an
     axially symmetric solid from it?
     Thanks
     Dylan_______________________________________________
     OpenSCAD mailing list
     To unsubscribe send an email to discuss-

 leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org>

     <mailto:discuss-leave@lists.openscad.org <mailto:discuss-

 leave@lists.openscad.org>>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

 <mailto:discuss-leave@lists.openscad.org>
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

That limited number of measurements is due to being at the experimental stage - if necessary, there could be many more reference points. Your screenshots indeed show what I am trying to achieve, but HOW did you do it? D On 27/07/2025 15:31, Sanjeev Prabhakar via Discuss wrote: > with the limited points available. You have to manually fit the curve. > my guess is like below, if my understanding of the points you shared is > correct. > Screenshot 2025-07-27 at 7.53.59 PM.png > Screenshot 2025-07-27 at 7.59.00 PM.png > > On Sun, 27 Jul, 2025, 7:10 pm Dylan via Discuss, > <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: > > Example measures (in mm) for a theoretical instrument: > > [[0, 50], [5, 55], [10, 50], [50, 20]] > > In reality, the full length would be at least 500mm and there may be 20 > or more measures. > > On 27/07/2025 14:20, Sanjeev Prabhakar via Discuss wrote: > > Can you share the list of coordinates > > > > On Sun, 27 Jul, 2025, 6:38 pm Dylan via Discuss, > > <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org> > <mailto:discuss@lists.openscad.org > <mailto:discuss@lists.openscad.org>>> wrote: > > > >     I need to model musical instruments which are, basically, > flared tubes. > >     The attached image shows examples (these are shawms, and each > is two > >     pieces: the main body of the instrument and a small insert > which holds > >     the reed - I'm focusing on the main body.) > >     I have a list of measurements which are each [distance-from-end, > >     diameter]; effectively [x,y] or [x,z] coordinates. > >     Is there a way to generate a curve which passes through each > >     measurement > >     point? I have looked into bézier curves (which is how I would > approach > >     this in Blender) but they don't seem to function the same way > as the > >     curve does not pass through the given points. > >     Secondly, once such a curve is generated, how would I generate an > >     axially symmetric solid from it? > >     Thanks > >     Dylan_______________________________________________ > >     OpenSCAD mailing list > >     To unsubscribe send an email to discuss- > leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > >     <mailto:discuss-leave@lists.openscad.org <mailto:discuss- > leave@lists.openscad.org>> > > > > > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > <mailto:discuss-leave@lists.openscad.org> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > <mailto:discuss-leave@lists.openscad.org> > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Sun, Jul 27, 2025 2:46 PM

Ok,
So there are 4 points

you can write a function to create arc with first 3 points (counter
clockwise)

There could be another function to create an arc with the last 2 points.

last 2 points arc is clockwise with radius 50.

join the 2 arcs to get the fitting curve (you need to manually, visually
see for the continuity of the resultant curve)

once you have the curve rest is simple

On Sun, 27 Jul 2025 at 20:08, Dylan via Discuss discuss@lists.openscad.org
wrote:

That limited number of measurements is due to being at the experimental
stage - if necessary, there could be many more reference points.
Your screenshots indeed show what I am trying to achieve, but HOW did
you do it?
D

On 27/07/2025 15:31, Sanjeev Prabhakar via Discuss wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you shared is
correct.
Screenshot 2025-07-27 at 7.53.59 PM.png
Screenshot 2025-07-27 at 7.59.00 PM.png

On Sun, 27 Jul, 2025, 7:10 pm Dylan via Discuss,
<discuss@lists.openscad.org mailto:discuss@lists.openscad.org> wrote:

 Example measures (in mm) for a theoretical instrument:

 [[0, 50], [5, 55], [10, 50], [50, 20]]

 In reality, the full length would be at least 500mm and there may be

20

 or more measures.

 On 27/07/2025 14:20, Sanjeev Prabhakar via Discuss wrote:

Can you share the list of coordinates

On Sun, 27 Jul, 2025, 6:38 pm Dylan via Discuss,
<discuss@lists.openscad.org mailto:discuss@lists.openscad.org

 <mailto:discuss@lists.openscad.org
 <mailto:discuss@lists.openscad.org>>> wrote:
 I need to model musical instruments which are, basically,
 flared tubes.
 The attached image shows examples (these are shawms, and each
 is two
 pieces: the main body of the instrument and a small insert
 which holds
 the reed - I'm focusing on the main body.)
 I have a list of measurements which are each

[distance-from-end,

 diameter]; effectively [x,y] or [x,z] coordinates.
 Is there a way to generate a curve which passes through each
 measurement
 point? I have looked into bézier curves (which is how I would
 approach
 this in Blender) but they don't seem to function the same way
 as the
 curve does not pass through the given points.
 Secondly, once such a curve is generated, how would I

generate an

 axially symmetric solid from it?
 Thanks
 Dylan_______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-
 leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org>
 <mailto:discuss-leave@lists.openscad.org <mailto:discuss-
 leave@lists.openscad.org>>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

 <mailto:discuss-leave@lists.openscad.org>
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org
 <mailto:discuss-leave@lists.openscad.org>

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Ok, So there are 4 points you can write a function to create arc with first 3 points (counter clockwise) There could be another function to create an arc with the last 2 points. last 2 points arc is clockwise with radius 50. join the 2 arcs to get the fitting curve (you need to manually, visually see for the continuity of the resultant curve) once you have the curve rest is simple On Sun, 27 Jul 2025 at 20:08, Dylan via Discuss <discuss@lists.openscad.org> wrote: > That limited number of measurements is due to being at the experimental > stage - if necessary, there could be many more reference points. > Your screenshots indeed show what I am trying to achieve, but HOW did > you do it? > D > > On 27/07/2025 15:31, Sanjeev Prabhakar via Discuss wrote: > > with the limited points available. You have to manually fit the curve. > > my guess is like below, if my understanding of the points you shared is > > correct. > > Screenshot 2025-07-27 at 7.53.59 PM.png > > Screenshot 2025-07-27 at 7.59.00 PM.png > > > > On Sun, 27 Jul, 2025, 7:10 pm Dylan via Discuss, > > <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org>> wrote: > > > > Example measures (in mm) for a theoretical instrument: > > > > [[0, 50], [5, 55], [10, 50], [50, 20]] > > > > In reality, the full length would be at least 500mm and there may be > 20 > > or more measures. > > > > On 27/07/2025 14:20, Sanjeev Prabhakar via Discuss wrote: > > > Can you share the list of coordinates > > > > > > On Sun, 27 Jul, 2025, 6:38 pm Dylan via Discuss, > > > <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org> > > <mailto:discuss@lists.openscad.org > > <mailto:discuss@lists.openscad.org>>> wrote: > > > > > > I need to model musical instruments which are, basically, > > flared tubes. > > > The attached image shows examples (these are shawms, and each > > is two > > > pieces: the main body of the instrument and a small insert > > which holds > > > the reed - I'm focusing on the main body.) > > > I have a list of measurements which are each > [distance-from-end, > > > diameter]; effectively [x,y] or [x,z] coordinates. > > > Is there a way to generate a curve which passes through each > > > measurement > > > point? I have looked into bézier curves (which is how I would > > approach > > > this in Blender) but they don't seem to function the same way > > as the > > > curve does not pass through the given points. > > > Secondly, once such a curve is generated, how would I > generate an > > > axially symmetric solid from it? > > > Thanks > > > Dylan_______________________________________________ > > > OpenSCAD mailing list > > > To unsubscribe send an email to discuss- > > leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org> > > > <mailto:discuss-leave@lists.openscad.org <mailto:discuss- > > leave@lists.openscad.org>> > > > > > > > > > _______________________________________________ > > > OpenSCAD mailing list > > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > <mailto:discuss-leave@lists.openscad.org> > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > <mailto:discuss-leave@lists.openscad.org> > > > > > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
WF
William F. Adams
Sun, Jul 27, 2025 3:29 PM

On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via Discuss discuss@lists.openscad.org wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you shared is correct.

Source code for this image?

William

On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via Discuss <discuss@lists.openscad.org> wrote: >with the limited points available. You have to manually fit the curve. >my guess is like below, if my understanding of the points you shared is correct. Source code for this image? William
JB
Jon Bondy
Sun, Jul 27, 2025 3:35 PM

Glenn:

Wonderfully simple and elegant!  Thank you!

Jon

On 7/27/2025 10:34 AM, Glenn Butcher via Discuss wrote:

On 7/27/2025 7:52 AM, Dylan via Discuss wrote:

I only find extrude functions, which extrude a shape along a path, or
around an existing object. I effectively need to 'spin' the curve
(path/bezier/whatever) around an axis.

rotate_extrude() in the OpenSCAD language does exactly that.

Beziers and other parametric curves will work well if you can find the
particular parameters that describe your instrument's profile.  I've
been modeling steam locomotive parts, and in a lot of them the
profiles are a vexing combination of straight lines and arbitrary
curves.  I found an OpenSCAD library called 'Round-Anything', has a
function called polyRound() that'll take an array of points with
attached radii and generate a set of points that replace the "pointed"
points with curves, and leave the others as they are.  You can find it
here:

https://github.com/Irev-Dev/Round-Anything

There's one file there, polyround.scad, the only one you need to do
what I describe.  A short code to use it to make a locomotive steam dome:

use <polyround.scad>

pts = [
[0.000,0.000,0.000],
[0.000,1.884,0.000],
[0.115,1.891,0.050],
[0.115,1.755,0.000],
[0.331,1.755,0.050],
[0.338,1.913,0.050],
[0.475,1.920,0.050],
[0.475,1.776,0.050],
[0.942,1.676,0.500],
[1.280,1.482,1.000],
[1.280,0.187,0.000],
[1.374,0.129,0.000],
[1.575,0.137,0.500],
[1.575,0.000,0.000]
];

$fn=90;
rotate_extrude(360) polygon(polyRound(pts, 20));


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Glenn: Wonderfully simple and elegant!  Thank you! Jon On 7/27/2025 10:34 AM, Glenn Butcher via Discuss wrote: > On 7/27/2025 7:52 AM, Dylan via Discuss wrote: >> >> I only find extrude functions, which extrude a shape along a path, or >> around an existing object. I effectively need to 'spin' the curve >> (path/bezier/whatever) around an axis. >> > rotate_extrude() in the OpenSCAD language does exactly that. > > Beziers and other parametric curves will work well if you can find the > particular parameters that describe your instrument's profile.  I've > been modeling steam locomotive parts, and in a lot of them the > profiles are a vexing combination of straight lines and arbitrary > curves.  I found an OpenSCAD library called 'Round-Anything', has a > function called polyRound() that'll take an array of points with > attached radii and generate a set of points that replace the "pointed" > points with curves, and leave the others as they are.  You can find it > here: > > https://github.com/Irev-Dev/Round-Anything > > There's one file there, polyround.scad, the only one you need to do > what I describe.  A short code to use it to make a locomotive steam dome: > > use <polyround.scad> > > pts = [ > [0.000,0.000,0.000], > [0.000,1.884,0.000], > [0.115,1.891,0.050], > [0.115,1.755,0.000], > [0.331,1.755,0.050], > [0.338,1.913,0.050], > [0.475,1.920,0.050], > [0.475,1.776,0.050], > [0.942,1.676,0.500], > [1.280,1.482,1.000], > [1.280,0.187,0.000], > [1.374,0.129,0.000], > [1.575,0.137,0.500], > [1.575,0.000,0.000] > ]; > > $fn=90; > rotate_extrude(360) polygon(polyRound(pts, 20)); > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG antivirus software. www.avg.com
GB
Glenn Butcher
Sun, Jul 27, 2025 3:42 PM

Thanks.  It's like those TV commercials for the hot sauce: "I use that
s&*t on everything!"

I just counted; on my steam locomotive, I used polyRound() 75 times.
Code, and a picture, are here:

https://github.com/butcherg/DRG_168

Glenn

On 7/27/2025 9:35 AM, Jon Bondy wrote:

Glenn:

Wonderfully simple and elegant!  Thank you!

Jon

On 7/27/2025 10:34 AM, Glenn Butcher via Discuss wrote:

On 7/27/2025 7:52 AM, Dylan via Discuss wrote:

I only find extrude functions, which extrude a shape along a path,
or around an existing object. I effectively need to 'spin' the curve
(path/bezier/whatever) around an axis.

rotate_extrude() in the OpenSCAD language does exactly that.

Beziers and other parametric curves will work well if you can find
the particular parameters that describe your instrument's profile. 
I've been modeling steam locomotive parts, and in a lot of them the
profiles are a vexing combination of straight lines and arbitrary
curves.  I found an OpenSCAD library called 'Round-Anything', has a
function called polyRound() that'll take an array of points with
attached radii and generate a set of points that replace the
"pointed" points with curves, and leave the others as they are.  You
can find it here:

https://github.com/Irev-Dev/Round-Anything

There's one file there, polyround.scad, the only one you need to do
what I describe.  A short code to use it to make a locomotive steam dome:

use <polyround.scad>

pts = [
[0.000,0.000,0.000],
[0.000,1.884,0.000],
[0.115,1.891,0.050],
[0.115,1.755,0.000],
[0.331,1.755,0.050],
[0.338,1.913,0.050],
[0.475,1.920,0.050],
[0.475,1.776,0.050],
[0.942,1.676,0.500],
[1.280,1.482,1.000],
[1.280,0.187,0.000],
[1.374,0.129,0.000],
[1.575,0.137,0.500],
[1.575,0.000,0.000]
];

$fn=90;
rotate_extrude(360) polygon(polyRound(pts, 20));


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

Thanks.  It's like those TV commercials for the hot sauce: "I use that s&*t on everything!" I just counted; on my steam locomotive, I used polyRound() 75 times. Code, and a picture, are here: https://github.com/butcherg/DRG_168 Glenn On 7/27/2025 9:35 AM, Jon Bondy wrote: > > Glenn: > > Wonderfully simple and elegant!  Thank you! > > Jon > > > On 7/27/2025 10:34 AM, Glenn Butcher via Discuss wrote: >> On 7/27/2025 7:52 AM, Dylan via Discuss wrote: >>> >>> I only find extrude functions, which extrude a shape along a path, >>> or around an existing object. I effectively need to 'spin' the curve >>> (path/bezier/whatever) around an axis. >>> >> rotate_extrude() in the OpenSCAD language does exactly that. >> >> Beziers and other parametric curves will work well if you can find >> the particular parameters that describe your instrument's profile.  >> I've been modeling steam locomotive parts, and in a lot of them the >> profiles are a vexing combination of straight lines and arbitrary >> curves.  I found an OpenSCAD library called 'Round-Anything', has a >> function called polyRound() that'll take an array of points with >> attached radii and generate a set of points that replace the >> "pointed" points with curves, and leave the others as they are.  You >> can find it here: >> >> https://github.com/Irev-Dev/Round-Anything >> >> There's one file there, polyround.scad, the only one you need to do >> what I describe.  A short code to use it to make a locomotive steam dome: >> >> use <polyround.scad> >> >> pts = [ >> [0.000,0.000,0.000], >> [0.000,1.884,0.000], >> [0.115,1.891,0.050], >> [0.115,1.755,0.000], >> [0.331,1.755,0.050], >> [0.338,1.913,0.050], >> [0.475,1.920,0.050], >> [0.475,1.776,0.050], >> [0.942,1.676,0.500], >> [1.280,1.482,1.000], >> [1.280,0.187,0.000], >> [1.374,0.129,0.000], >> [1.575,0.137,0.500], >> [1.575,0.000,0.000] >> ]; >> >> $fn=90; >> rotate_extrude(360) polygon(polyRound(pts, 20)); >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free.www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
SP
Sanjeev Prabhakar
Sun, Jul 27, 2025 3:44 PM

I will write it in openscad and send it just for the larger population here.

Nowadays I am working in python, so may not be very useful to many.

On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, willadams@aol.com wrote:

On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via Discuss
discuss@lists.openscad.org wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you shared is

correct.

Source code for this image?

William

I will write it in openscad and send it just for the larger population here. Nowadays I am working in python, so may not be very useful to many. On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, <willadams@aol.com> wrote: > On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via Discuss > <discuss@lists.openscad.org> wrote: > > >with the limited points available. You have to manually fit the curve. > >my guess is like below, if my understanding of the points you shared is > correct. > > Source code for this image? > > William >
D
Dylan
Sun, Jul 27, 2025 3:57 PM

The python would be most useful for me...
D

On 27/07/2025 16:44, Sanjeev Prabhakar via Discuss wrote:

I will write it in openscad and send it just for the larger population here.

Nowadays I am working in python, so may not be very useful to many.

On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, <willadams@aol.com
mailto:willadams@aol.com> wrote:

 On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via
 Discuss <discuss@lists.openscad.org
 <mailto:discuss@lists.openscad.org>> wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you

 shared is correct.

 Source code for this image?

 William

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

The python would be most useful for me... D On 27/07/2025 16:44, Sanjeev Prabhakar via Discuss wrote: > I will write it in openscad and send it just for the larger population here. > > Nowadays I am working in python, so may not be very useful to many. > > On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, <willadams@aol.com > <mailto:willadams@aol.com>> wrote: > > On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via > Discuss <discuss@lists.openscad.org > <mailto:discuss@lists.openscad.org>> wrote: > > >with the limited points available. You have to manually fit the curve. > >my guess is like below, if my understanding of the points you > shared is correct. > > Source code for this image? > > William > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
D
Dylan
Sun, Jul 27, 2025 3:59 PM

Thanks, this looks like just what I need.
D

On 27/07/2025 15:34, Glenn Butcher via Discuss wrote:

On 7/27/2025 7:52 AM, Dylan via Discuss wrote:

I only find extrude functions, which extrude a shape along a path, or
around an existing object. I effectively need to 'spin' the curve
(path/bezier/whatever) around an axis.

rotate_extrude() in the OpenSCAD language does exactly that.

Beziers and other parametric curves will work well if you can find the
particular parameters that describe your instrument's profile.  I've
been modeling steam locomotive parts, and in a lot of them the profiles
are a vexing combination of straight lines and arbitrary curves.  I
found an OpenSCAD library called 'Round-Anything', has a function called
polyRound() that'll take an array of points with attached radii and
generate a set of points that replace the "pointed" points with curves,
and leave the others as they are.  You can find it here:

https://github.com/Irev-Dev/Round-Anything

There's one file there, polyround.scad, the only one you need to do what
I describe.  A short code to use it to make a locomotive steam dome:

use <polyround.scad>

pts = [
[0.000,0.000,0.000],
[0.000,1.884,0.000],
[0.115,1.891,0.050],
[0.115,1.755,0.000],
[0.331,1.755,0.050],
[0.338,1.913,0.050],
[0.475,1.920,0.050],
[0.475,1.776,0.050],
[0.942,1.676,0.500],
[1.280,1.482,1.000],
[1.280,0.187,0.000],
[1.374,0.129,0.000],
[1.575,0.137,0.500],
[1.575,0.000,0.000]
];

$fn=90;
rotate_extrude(360) polygon(polyRound(pts, 20));


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks, this looks like just what I need. D On 27/07/2025 15:34, Glenn Butcher via Discuss wrote: > On 7/27/2025 7:52 AM, Dylan via Discuss wrote: >> >> I only find extrude functions, which extrude a shape along a path, or >> around an existing object. I effectively need to 'spin' the curve >> (path/bezier/whatever) around an axis. >> > rotate_extrude() in the OpenSCAD language does exactly that. > > Beziers and other parametric curves will work well if you can find the > particular parameters that describe your instrument's profile.  I've > been modeling steam locomotive parts, and in a lot of them the profiles > are a vexing combination of straight lines and arbitrary curves.  I > found an OpenSCAD library called 'Round-Anything', has a function called > polyRound() that'll take an array of points with attached radii and > generate a set of points that replace the "pointed" points with curves, > and leave the others as they are.  You can find it here: > > https://github.com/Irev-Dev/Round-Anything > > There's one file there, polyround.scad, the only one you need to do what > I describe.  A short code to use it to make a locomotive steam dome: > > use <polyround.scad> > > pts = [ > [0.000,0.000,0.000], > [0.000,1.884,0.000], > [0.115,1.891,0.050], > [0.115,1.755,0.000], > [0.331,1.755,0.050], > [0.338,1.913,0.050], > [0.475,1.920,0.050], > [0.475,1.776,0.050], > [0.942,1.676,0.500], > [1.280,1.482,1.000], > [1.280,0.187,0.000], > [1.374,0.129,0.000], > [1.575,0.137,0.500], > [1.575,0.000,0.000] > ]; > > $fn=90; > rotate_extrude(360) polygon(polyRound(pts, 20)); > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
GB
Glenn Butcher
Sun, Jul 27, 2025 4:05 PM

Of note, the third number in the point triple is a radius, and you have
to pay attention to the length of the adjacent lines to determine what
that should be.  Also, set it to 0.0, and the point will be left alone.

On 7/27/2025 9:59 AM, Dylan via Discuss wrote:

Thanks, this looks like just what I need.
D

Of note, the third number in the point triple is a radius, and you have to pay attention to the length of the adjacent lines to determine what that should be.  Also, set it to 0.0, and the point will be left alone. On 7/27/2025 9:59 AM, Dylan via Discuss wrote: > Thanks, this looks like just what I need. > D > >
SP
Sanjeev Prabhakar
Sun, Jul 27, 2025 4:16 PM

for the python guys
following is the code :

from openscad3 import *
a=[[0, 50], [5, 55], [10, 50], [50, 20]]
b=[translate_2d([0,x],circle(y/2)) for (x,y) in a]
l1=cpo(b)[0]
l2=arc_3p(l1[0],l1[1],l1[2],s=10)
l3=arc_2p(l1[2],l1[3],50,s=20)
sec=l2+l3[1:]
sec1=rot('x90',sec)
s1=cpo([rot(f'z{i}',sec1) for i in linspace(0,360,50)[:-1]])
s2=surface_thicken_1(s1,1)
fileopen(f'''
color("blue") for(p={[sec]}) p_line3d(p,.3);
color("magenta") points({l1},.75);
//{swp_c(s2)}
''')

For this code to run, you need to download my library openscad3.py
https://github.com/sprabhakar2006/openSCAD/blob/main/openscad3.py

If you are lucky to setup things correctly, you will be able to see the
file trial.scad

On Sun, 27 Jul 2025 at 21:14, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I will write it in openscad and send it just for the larger population
here.

Nowadays I am working in python, so may not be very useful to many.

On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, willadams@aol.com wrote:

On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via
Discuss discuss@lists.openscad.org wrote:

with the limited points available. You have to manually fit the curve.
my guess is like below, if my understanding of the points you shared is

correct.

Source code for this image?

William

for the python guys following is the code : from openscad3 import * a=[[0, 50], [5, 55], [10, 50], [50, 20]] b=[translate_2d([0,x],circle(y/2)) for (x,y) in a] l1=cpo(b)[0] l2=arc_3p(l1[0],l1[1],l1[2],s=10) l3=arc_2p(l1[2],l1[3],50,s=20) sec=l2+l3[1:] sec1=rot('x90',sec) s1=cpo([rot(f'z{i}',sec1) for i in linspace(0,360,50)[:-1]]) s2=surface_thicken_1(s1,1) fileopen(f''' color("blue") for(p={[sec]}) p_line3d(p,.3); color("magenta") points({l1},.75); //{swp_c(s2)} ''') For this code to run, you need to download my library openscad3.py https://github.com/sprabhakar2006/openSCAD/blob/main/openscad3.py If you are lucky to setup things correctly, you will be able to see the file trial.scad On Sun, 27 Jul 2025 at 21:14, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I will write it in openscad and send it just for the larger population > here. > > Nowadays I am working in python, so may not be very useful to many. > > On Sun, 27 Jul, 2025, 8:59 pm William F. Adams, <willadams@aol.com> wrote: > >> On Sunday, July 27, 2025 at 10:32:22 AM EDT, Sanjeev Prabhakar via >> Discuss <discuss@lists.openscad.org> wrote: >> >> >with the limited points available. You have to manually fit the curve. >> >my guess is like below, if my understanding of the points you shared is >> correct. >> >> Source code for this image? >> >> William >> >