curv3d / curv

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

Error when generating an obj file and using -O jit #94

Closed winksaville closed 4 years ago

winksaville commented 4 years ago

Describe the bug Error generating an obj file when using -O jit, it looks to be related to the new polygon shape. There was no issue when I used a rect. Also, as shown below, without -O jit the tri.curv programed worked.

Curv Program

$ cat tri.curv
polygon [[-5, 0], [0, 10], [5, 0]]
>> extrude 20

To Reproduce run curv with -O jit on the above program

$ curv -o tri.obj -O jit tri.curv
/home/wink/prgs/curv3d/projects/polygons/,curv-147910-0.cpp: In function ‘void dist(const vec4*, float*)’:
/home/wink/prgs/curv3d/projects/polygons/,curv-147910-0.cpp:74:15: error: no match for ‘operator!’ (operand type is ‘glm::bvec3’ {aka ‘glm::vec<3, bool, glm::packed_highp>’})
   74 |   bvec3 r58 = not(r52);
      |               ^~~~~~~~
/home/wink/prgs/curv3d/projects/polygons/,curv-147910-0.cpp:74:15: note: candidate: ‘operator!(bool)’ (built-in)
/home/wink/prgs/curv3d/projects/polygons/,curv-147910-0.cpp:74:15: note:   no known conversion for argument 1 from ‘glm::bvec3’ {aka ‘glm::vec<3, bool, glm::packed_highp>’} to ‘bool’
ERROR: c++ compile failed; see "/home/wink/prgs/curv3d/projects/polygons/,curv-147910-0.cpp"

Without -O jit it works and I was able to view the tri.obj in prusa-slicer:

$ curv -o tri.obj tri.curv
You are in SLOW MODE. Use '-O jit' to speed up rendering.
vsize=0.271442: 43×42×79 voxels. Use '-O vsize=N' to change voxel size.
Rendered 142674 voxels in 2.00806s (71050 voxels/s).
12702 quads.

Expected behavior No error when using -O jit

System Information (please complete the following information):

Additional context Add any other context about the problem here.

doug-moen commented 4 years ago

Thanks!

winksaville commented 4 years ago

FYI: Something I discovered very recently. You can link pull requests "automatically" to issues which can be handy as the person who created the issue will see what commit fixed it.

On Sun, Jun 14, 2020, 6:39 PM Doug Moen notifications@github.com wrote:

Closed #94 https://github.com/curv3d/curv/issues/94.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/curv3d/curv/issues/94#event-3442282761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2CHBQQR75MH2KI5IC5CLRWV3VRANCNFSM4N5WJBAA .

winksaville commented 4 years ago

Whoops, here is the link: https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue

On Sun, Jun 14, 2020, 7:06 PM Wink Saville wink@saville.com wrote:

FYI: Something I discovered very recently. You can link pull requests "automatically" to issues which can be handy as the person who created the issue will see what commit fixed it.

On Sun, Jun 14, 2020, 6:39 PM Doug Moen notifications@github.com wrote:

Closed #94 https://github.com/curv3d/curv/issues/94.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/curv3d/curv/issues/94#event-3442282761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2CHBQQR75MH2KI5IC5CLRWV3VRANCNFSM4N5WJBAA .

doug-moen commented 4 years ago

Thanks, I'll try this next time.

winksaville commented 4 years ago

Cool, I've used "Fixes #XX" in the last "paragraph" on another repo and seemed to work.

On Mon, Jun 15, 2020, 5:22 PM Doug Moen notifications@github.com wrote:

Thanks, I'll try this next time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/curv3d/curv/issues/94#issuecomment-644458037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2CHEDIBWQ3MUARJK5SDLRW23NHANCNFSM4N5WJBAA .