############################################### # scriptfile: usr_importbinary2_3d.lsf # # description: This file creates shows how to import # a binary data from script variables. # # Copyright 2013, Lumerical Solutions, Inc. ############################################### # generate a volume of binary data radius = 50; x = linspace(-radius,radius,100); y = linspace(-radius,radius,101); z = linspace(-radius,radius,102); X = meshgrid3dx(x,y,z); Y = meshgrid3dy(x,y,z); Z = meshgrid3dz(x,y,z); binary = (X^2+Y^2+Z^2) <= radius^2; # add an import object addimport; # import the data from file x = x*1e-9; # switch to SI units y = y*1e-9; # switch to SI units z = z*1e-9; # switch to SI units importbinary2(binary,x,y,z); set("material","Au (Gold) - CRC");