# 3D parametric plot with Open SCAD

7 messages
Open this post in threaded view
|

## 3D parametric plot with Open SCAD

 Dear all, I would like to make a three-dimensional parametric plot of the form x = f(u,v) y = g(u,v) z = h(u,v) as a function of the two parameters u_min < u < u_max, v_min < v < v_max in Open SCAD. Do you know how to do this? Note that this is different from plotting a function of two variables, z = f(x,y), for which there are OpenSCAD libraries available, such as  this one  . Thank you for your help. Best, -- 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: 3D parametric plot with Open SCAD

Open this post in threaded view
|

## Re: 3D parametric plot with Open SCAD

Open this post in threaded view
|

## Re: 3D parametric plot with Open SCAD

 This is exactly what I was looking for, thank you. However, the file gives me a compilation error, see the screenshot attached. Do you know why I get this error? Thanks -- 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: 3D parametric plot with Open SCAD

 I was under the impression you were looking for a parametric patch: function f(x,y)=cos(x)*cos(y); function g(x,y)=cos(x)*sin(y); function h(x,y)=sin(x); xmin=-45; xmax=45; xsteps=12; ymin=-45; ymax=45; ysteps=12; xstep=(xmax-xmin)/(xsteps); ystep=(ymax-ymin)/(ysteps); points=[ for(j=[0:xsteps]) for(i=[0:ysteps]) [ f(xmin+j*xstep,ymin+i*ystep), g(xmin+j*xstep,ymin+i*ystep), h(xmin+j*xstep,ymin+i*ystep) ] ]; faces=[ for(j=[0:xsteps-1]) for (i=[0:ysteps-1]) [ i +(ysteps+1) +j*(ysteps+1), i+1 +(ysteps+1) +j*(ysteps+1), i+1 +j*(ysteps+1), i +j*(ysteps+1) ] ] ; polyhedron( points=points, faces=faces ); This doesn't produce a closed surface. Sent from the OpenSCAD mailing list archive at Nabble.com._______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org