bullet-physics-playground / bpp

The Bullet Physics Playground – Bullet Real-Time Physics Simulation.
https://github.com/bullet-physics-playground
Other
35 stars 6 forks source link

Idea – Create an OpenSCAD class #5

Closed koppi closed 8 years ago

koppi commented 8 years ago

To have basic CSG meshes in bpp two ideas popped up:

1) Create an OpenSCAD class, which on instantiation creates from the OpenSCAD text an STL file, which gets loaded into bpp. The class should do caching of the generated STL files, i.e.: create a checksum of the OpenSCAD input text and cache the STL data in ~/.bpp/cache/stl and only call OpenSCAD if the input changed or the STL file does not yet exist. Example:

mesh = OpenSCAD([[[  // torus
scale(6)
rotate_extrude(convexity = 10, $fn=50)
translate([2, 0, 0])
circle(r = 1, $fn=50);
]]])
v:add(mesh)

2) hgpovray exports STL files from basic POV objects, see: https://github.com/LeForgeron/povray/wiki/Tesselation

koppi commented 8 years ago

See https://github.com/bullet-physics-playground/bpp/commit/906dcdeaf8fd38b834c7a64bb67b87db33485200 https://github.com/bullet-physics-playground/bpp/commit/778cb2dd31381b5239db3627b2f0d8ff576a1d1d .