# [OpenSCAD] evenly cutting two curves to make surfaces

Mon Sep 7 15:09:22 EDT 2015

```Your wavy curve doesnt stick out much over the smooth curve.
So I scaled the smooth body by scale([.9,.9,1])

If you can cut your curve into concave sections, you can just chain-hull
while rotating around the z axis, scaling the wave curve while you rotate
around.

2015-09-07 19:22 GMT+02:00 runsun <runsun at gmail.com>:

> Hi Neon, it seems that your problem can be approached with simple
> interpolation, based on the observation that each line segment between two
> points is, or nearly is, a straight line.
>
> The following is the smooth_points[25] to [26] of your data (blue). Just
> increase the y by dy (set to 2.35 here) repeatedly (red horizontal lines),
> see if it gets larger than any given smooth_points[i].y. If yes, calc the
> slope between  smooth_points[i] and [j] (green). The interpolated point at
> that y can thus be obtained (I250, I251 and I261).
>
>
> Here are the functions that generate the I250, I251 and I261 in the above
> graph:
>
>
> > function slope(pts,i)=
> >      (pts[i+1][1]-pts[i][1] ) / (pts[i+1][0]-pts[i][0] );
> >
> > function interpolate( pts, i, y=begY )=
> >      let( slope= slope( pts, i ) )
> >      [ pts[i][0]+ (y-pts[i][1])/slope, y ];
> >
> > I250= interpolate( smooth_points, 25);
> > I251= interpolate( smooth_points, 25, y=begY+dy);
> > I260= interpolate( smooth_points, 26, y=begY+dy*2);
>
> destination, more manipulations are needed. But lets see how you will take
> it from here.
>
>
>
> -----
>
> \$  Runsun Pan, PhD
>
> \$ -- libs: doctest , faces ( git ), offliner ( git );
>
>  tips: hash( 1 , 2 ), sweep , var
>
> \$ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD 2015.03.15/2015.04.01.nightly
>
>
>
>
> --
> View this message in context:
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
>

--
stempeldergeschichte at googlemail.com <karsten at rohrbach.de>

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.