Hi,
In order to load it into mumax, you would first need to convert the STL file into the OVF format, and then load it in using regions.loadfile(). You would need to write a script in something like Matlab or Python.
There are 2 alternatives to form the geometry in mumax. You could try to build the octahedron from simpler shapes (mumax has a bunch of primitive shapes like cuboids etc, as listed on the example and API pages. These shapes can be manipulated with rotations, translations, etc). If you take a cube and intersect it with xrange's and yrange's (or the triangle shape) that are appropriately rotated/translated, you should be able to form a pyramid fairly easily. And then copy and rotate that pyramid. Something like:
SetGridsize(100, 100, 100)
SetCellsize(1e-6/100, 1e-6/100, 1e-6/100)
a:=cuboid(500e-9, 500e-9, 500e-9).intersect(xrange(-inf,0).transl(250e-9,0,0).roty(-45*pi/180).transl(0,0,-250e-9) )
b:=cuboid(500e-9, 500e-9, 500e-9).intersect(xrange(0,inf).transl(-250e-9,0,0).roty(45*pi/180).transl(0,0,-250e-9) )
c:=cuboid(500e-9, 500e-9, 500e-9).intersect(yrange(-inf,0).transl(0,250e-9,0).rotx(45*pi/180).transl(0,0,-250e-9) )
d:=cuboid(500e-9, 500e-9, 500e-9).intersect(yrange(0,inf).transl(0,-250e-9,0).rotx(-45*pi/180).transl(0,0,-250e-9) )
ff:=a.intersect(b)
gg:=ff.intersect(c)
hh:=gg.intersect(d)
ii:=hh.intersect(zrange(-125e-9,inf))
jj:=ii.roty(180*pi/180).transl(0,0,1e-6/100)
kk:=ii.intersect(jj)
setgeom( kk)
m=uniform(1,0,0)
save(m)
I'm not sure if that's exactly right, so please double check it. But that should at least give you a good idea.
A third method would be to use the equation for the regular octohedron. It is defined as abs(x)+abs(y)+abs(z)=1 . You can use the index2coord function for each cell, you can define if something is inside or outside of the object. This is not a particularly pretty/efficient example, but something like:
Nx := 32
Ny := 32
Nz := 32
c := 5e-9
setgridsize(Nx, Ny, Nz)
setcellsize(c, c, c)
for i:=0; i<Nx; i++{
for j:=0; j<Ny; j++{
for k:=0; k<Nz; k++{
r := index2coord(i, j, k)
x := r.X()
y := r.Y()
z := r.Z()
if (abs(x)+abs(y)+abs(z)) < 5e-8 {
regions.setcell(i,j,k,1)
}else {regions.setcell(i,j,k,0)}
}}}
m.setregion(1, uniform(1,0,0))
m.setregion(0, uniform(0,0,-1))
OutputFormat = OVF2_TEXT
save(regions)
This will probably be very slow for large values, but you get the idea. (also, you only need to do it once. Once you have the OVF from doing save(regions), in future scripts you can just use regions.Loadfile(), instead of recalculating it from scratch again). There's probably a faster method than using regions.setcell in a loop, which is rather slow, using masks and then regions.Evalto(mask), but it's not coming to mind right now.
Best,
Josh L.