On 06/01/2012 10:37 AM, Noel Warren wrote:
> Well, I decided to go off and try Rice. Please bare in mind that I am
> not a professional programmer and I guess the bindings project scared me
> off (all that Cmake is intimidating!). What I have developed so far is
> here
http://code.google.com/p/rgal/ . But I still feel the project
> should work alongside the bindings project. I see Patrick Surry is
> working on Nefs. If he were to get it up and running I'd be willing to
> make a serious effort at porting it all to Ruby (Remember, no Cmake
> experience and limmited c++ know-how).
>
To me it's a bad to restart another project from scratch (for
maintenance purpose essentially). But I fully understand that you want
something that works and you have limited time.
> How would I get started? The python folder seems to only worry about
> iterators. How many Cmake files would I have to edit? Think others
> might need it?
>
The first step is just to write a macro so that you can compile in Ruby.
If you look at the file cmake/Modules/SWIG_CGAL_Macros.cmake, I think
you just need to copy-paste ADD_SWIG_CGAL_PYTHON_MODULE and create
ADD_SWIG_CGAL_RUBY_MODULE.
Then in the main CMakeLists.txt
you must add
option( BUILD_RUBY "Build Ruby bindings" ON )
and copy-paste-adapt the two blocks
if (${BUILD_PYTHON})
....
endif()
and
if (PYTHONLIBS_FOUND)
...
endif()
Then open SWIG_CGAL/Kernel/CMakeLists.txt and add the line for Ruby.
I think that's it. You need special code for iterators if you want to
make an advance use.
Sebastien
> 2012/5/18 Sebastien Loriot (GeometryFactory) <
slori...@gmail.com
> <mailto:
slori...@gmail.com>>
>
> Hi,
>
> you should try to use the CGAL bindings.
> The first step is to modify the cmake script (CMakeLists.txt)
> to make swig generating ruby files.
>
> IIRC, on the SWIG website you'll have information about how to
> compile using SWIG for Ruby,
>
> Please use the list
>
http://groups.google.com/__group/cgal-bindings-discuss
> <
http://groups.google.com/group/cgal-bindings-discuss>
> if you have any question.
>
> Best regards,
>
> Sebastien.
>
>
>
> On 05/15/2012 04:26 PM, Noel Warren wrote:
>
> Hi there Sebastien
> My name is Noel and am subscribed to the CGAL mailing list. I am
> interested in porting (wrapping, binding or whatever you call
> it) CGAL
> so I can use it in Ruby. I was planning to do it with Rice
> <
http://rice.rubyforge.org/>, mainly because it looks really
> easy. I've
>
> even booked
https://code.google.com/p/__rgal/
> <
https://code.google.com/p/rgal/>. I sent an email about this
> to Philipp Moller to make sure I wasn't setting myself up for a fall
> (I'm not exactly a c++ expert) and told me about you the
> cgal-bindings
> project.
>
> It would seem you have much or most of the work done for me(I
> need to
> use polyhera, nefs, planes, minkowski summs and perhaps envelopes).
> Reading the rice documentation however, it all seems a lot
> safer and
> idiot proof. Because I have never wrapped classes before I was
> hoping
> you could give me some advice. Would you recommend using
> cgal-bindings
> or using Rice to wrap my ruby classes.
>
> If I were to use Rice, I was thinking of changing my classes
> a little
> to make them a bit more ruby like. For instance I don't really
> see a
> need for an Polyhedron_incremental_builder class when you could just
> incorporate it into one of the Polyhedon's methods...
>
> P = Polyhedron.build___incrementally(pointArray, faceArray)
>
> I also find wierd that fact that Polyhedra are constants.
> You can
> modify them. Surely they should be variables. The fact I don't
> understand why makes me think I probably just don't understand C++
>
> Anyway, please let me know if i'm out of my depth or if I've said
> something really stupid. Cheers!
>
>
>