OpenSCAD use Part::Prism
This commit is contained in:
committed by
Yorik van Havre
parent
34cce64edc
commit
cf2d437c73
@@ -141,6 +141,16 @@ def process_object(csg,ob):
|
||||
if mm == 1 : csg.write("}\n")
|
||||
else : # Cannot convert to rotate extrude so best effort is polyhedron
|
||||
csg.write('%s\n' % shape2polyhedron(ob.Shape))
|
||||
elif ob.TypeId == "Part::Prism":
|
||||
import math
|
||||
f = str(ob.Polygon)
|
||||
# r = str(ob.Length/2.0/math.sin(math.pi/ob.Polygon))
|
||||
r = str(ob.Length) #length seems to be the outer radius
|
||||
h = str(ob.Height)
|
||||
mm = check_multmatrix(csg,ob,0,0,-float(h)/2)
|
||||
csg.write("cylinder($fn = "+f+", "+fafs+", h = "+h+", r1 = "+r+\
|
||||
", r2 = "+r+", center = "+center(mm)+");\n")
|
||||
if mm == 1: csg.write("}\n")
|
||||
|
||||
elif ob.TypeId == "Part::Extrusion" :
|
||||
print "Extrusion"
|
||||
|
||||
Reference in New Issue
Block a user