curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

`-O jit` rocks, and should be mentioned as soon as STL/OBJ/X3D exporting is mentioned #86

Closed Digital-Monk closed 4 years ago

Digital-Monk commented 4 years ago

Really just a doc issue, coming from the fact that apparently I'm super lazy. I saw curv -o thing.stl thing.curv in the overview and mostly stopped there. Learned about -O vsize from curv telling me directly, but it hurt to do my larger items at decent resolution. Didn't actually go to the Mesh_export docs, because it seemed like I could already do what I needed.

When I stumbled across -O jit and tried it, I was stunned! This is awesome and really ought to be mentioned earlier (or possibly made default, unless there's a problem with it in some situations).

doug-moen commented 4 years ago

-O jit depends on an external C++ compiler to compile the model into optimized machine code. Not all users have a C++ compiler available, for various reasons: some users copy the executable to another machine, or they run the executable in some kind of sandboxed environment.

I can try to automatically detect the presence of a C++ compiler and enable jit if C++ is found.

ComFreek commented 4 years ago

I had a hard time figuring out how to use -O jit. It should be documented (in ./curv --help and ./docs?) that it's only available in mesh export mode.

Sample (for future visitors):

 ./curv ../examples/mesh_only/klein.curv -o mesh.obj -O jit
doug-moen commented 4 years ago

I improved the documentation. -O jit is now documented in docs/README.rst, and curv now prints a warning during mesh export if -O jit is not enabled.