On Jan 30, 2008, at 2:14 AM, Paolo Bettotti wrote:
> Below ther's the relavant code:
>
> (set! geometry
>      (cons
>       (make block (center 0 0) (size 10 30) (material (make  
> dielectric (epsilon
> eps))))
>        (map
>         (lambda (x)
>         (geometric-object-duplicates (vector3 1 0) 0 10 (make cylinder  
> (center 0 x )
> (radius 0.35) (height infinity) (material air))))
> ;           (make block (center 0 (* x 1)) (size 5 0.5) (material  
> (make
> dielectric (index 1.0)))))
>         (arith-sequence 1 1 10))))

The problem is that geometric-object-duplicates returns a list of  
objects for each x.  So, when you do "map" what you get is not a list  
of of objects, but a list of lists of objects.

You need to collapse this into a single list of objects.  To do that  
you could do (apply append (map (lambda (x) geometric-object- 
duplicates .....))), which uses the "append" function to combine the  
list of lists into a single list of objects.

Steven


_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to