I’m trying to enable panel optimisation in my plugin and the code to do this properly is exceedingly complex so I’ve been trying to track down some code that already exists for this… I’ve have managed to track down a couple of c++ libraries that supposedly will do what i’m looking for. One in particular is…
So my question is… If this does work (i’ve sent an email to the company to enquire), can I run / access the c++ file / function from within ruby and obtain the results in ruby…?
would really appreciate it if anyone has any ideas on this? or in general the whole panel optimisation / 2d bin backing / 2d stock cutting problem thing???
I’ve been trying to get that example (GitHub - SketchUp/ruby-c-extension-examples: Ruby C extension examples) to work with the 64 bit version of SketchUp 2016. When I try to build a 64 bit version of the .so it throws a bunch of errors. And of course the 32 bit versions are giving me the following message in SketchUp:
Error: # LoadError: 193: %1 is not a valid Win32 application.
… which I understand is its way of saying I need a 64 bit .so file for the 64 bit version of SketchUp.
Is there any other examples that compile to a 64 bit .so file? I can’t for the life of me figure out why I can’t get this example to work in 64 bit.
For reference-- what I get when I try to compile the 64 bit version of the example using VS2015:
The version of Ruby included in the GitHub example predates VS2015, as you can tell by the _MSC_VER value expected by the ruby headers. I think we had manually upgraded those to VS2013 but have not done so for VS2015. If you can get it to compile, we’d love to see your changes be contributed back to the project.
Hm… after some hunting, it looks like I may have to stick with VS2013 for now. Apparently there is an outstanding bug where you can’t build Ruby with VS2015.
So if I understand, VS2013 can be used to compile this example. VS2015 can be configured as a front-end for the VS2013 build/compile/link tool chain. But since I never had VS2013 installed, I would need to install it so it is available to VS2015.
Not really a question I guess, just thinkin out loud. I’ll try it this evening.
Actually the example was compiled with VS2010, not VS2013.
So I went back to VS2013, but realized I had to rebuild Ruby 2.0 for VS2013 as the library in the example is for VS2010. I tried to do that in Windows 10… and it failed. Took the files over to a Windows 7 machine and was able to rebuild Ruby 2.0 for VS2013 there. Then took those libraries back to my Windows 10 machine to get it to work.
It finally did work. I’m almost back to getting some actual coding done.
Correct, the examples where originally VS2010. I got a branch with VS2013 tweaks, but I don’t think I pushed it back because I messed up something else in the configs.
did you already find some time to update to VS2015? It would be really great if you’d upload a new branch with the VS2015 version, or give me some hints what I’d have to do to get it compiling under VS2015 natively.