Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.11 KB

README.md

File metadata and controls

37 lines (29 loc) · 1.11 KB

Very basic .xcsg generator for Python.

Usable together with the xcsg and AngelCAD tools, AngelCAD is not mandatory, but good to have.

It is something like SolidPython for OpenSCAD.

Work is in progress, there is no documentation yet and it is probably quite buggy.

See samples.py for usage examples, see api.py for the available wrappers, and take a look at the xcsg wiki.

Usage example

example.py:

import math

from xcsg import rotate, X_AXIS, Y_AXIS, Sect3D, Cube, Sphere, Cylinder, save

cylinder = Cylinder(r=17, h=50, center=True)
shape = Sect3D()(
    Cube(size=45, center=True),
    Sphere(r=30))
shape -= (
    cylinder +
    rotate(ang=math.radians(90), axis=X_AXIS, obj=cylinder) +
    rotate(ang=math.radians(90), axis=Y_AXIS, obj=cylinder))

save('example.xcsg', shape)
$ python example.py
$ xcsg --obj example.xcsg
...
$ angelview example.obj

Alt text