El 19/12/13 11:54, jfrm.maurel at gmail.com escribi?:
> Hi,
>
> I would like to draw a 3d object like a cube for example with a random
> perturbation giving a smooth surface
> in the mind of figure 1
> (http://www.measurement.sk/Papers3/Durakbasa.pdf).
>
> Is there a way to do that with draw package ?
>
> Regards
>
Option 'transform' can be of some help:
Curve example:
p: makelist([k, sqrt(k), sin(0.2*k)], k, 100) $
draw3d(
point_type=dot,
key="Ideal curve",
points_joined=true,
points(p),
key="Real curve",
color=red,
transform=[x+'random(1.0)+5,y+'random(1.0)+5,z+'random(1.0)+5,x,y,z],
points(p)) $
Surface example:
m: apply(
matrix,
makelist(makelist(5*k^2,k,1,30),i,1,20)) $
draw3d(
surface_hide = true,
key="Ideal surface",
elevation_grid(m,0,0,3,2),
key="Real surface",
color=red,
transform = [x+'random(0.2)+2,y+'random(0.2)+2,z+'random(0.2)+2,x,y,z],
elevation_grid(m,0,0,3,2) )$
You should define your own smooth random perturbation, of course.
--
Mario