Sharp Cuboctahedron
This is a Cuboctahedron, but its edges are sharp.
It was made with pythonscad's new feature to render a sphere with a angle-dependent radius which is already available available in github.
Get pythonscad at http://pythonscad.org/
The simple used code is at the bottom.
You can easily change the sharpness by changing the exponent of the pow or basically creating other stuff instead.
=============
from openscad import
from math import
def dot(v1, v2):
return v1[0]v2[0] + v1[1]v2[1] + v1[2]*v2[2]
def mydotmax(v, dirs):
res = 0
for dir in dirs:
res = max(res, abs(dot(v, dir)))
return res
dirs=[]
dirs.append([0.0,0.0,1.0])
dirs.append([1.0,0.0,0.0])
dirs.append([0.0,1.0,0.0])
dirs.append([0.5,0.5,0.5])
dirs.append([0.5,0.5,-0.5])
dirs.append([0.5,-0.5,0.5])
dirs.append([0.5,-0.5,-0.5])
def rfunc(v):
cf = mydotmax(v, dirs)
return 10/pow(cf,1.5)
sphere(rfunc,fs=0.5,fn=10).show()