Creating:
polyline = PolyLine([[0,0],[0,10],[10,0],[0,0]])
polyline = PolyLine(generator=solid_object_2D)
Checking:
polyline.show()
Most functions in the OpenSCAD cheat sheet have an analogue here.
Creating:
solid_object = solid.cylinder()
solid_object = polyline.get_generator()
solid_object = polymesh.get_generator()
Checking:
solid.scad_render_to_file(solid_object, "output.scad")
# Convenience functions you might want to define
def solid_write(solid_object):
"""Writes out solidpython object"""
solid.scad_render_to_file(solid_object, "output.scad")
import os
def solid_show(solid_object):
"""Writes out solidpython object, then shows it in OpenSCAD"""
solid_write(solid_object)
os.system('openscad output.scad &')
Gotchas: When an numpy array is input, the commas may be removed. For example, solid.polygon(points=numpy.array([[...]])) won't render correctly.
Creating:
polymesh = PolyMesh(generator=solid_object_3D)
Checking:
polymesh.save("polymesh.scad")