SVGnest icon indicating copy to clipboard operation
SVGnest copied to clipboard

Plans on porting to C/C++ ?

Open redteam316 opened this issue 9 years ago • 18 comments

Any plans on porting this to C/C++ so that other language bindings (I.E. SWIG) can be made available?

redteam316 avatar Jan 22 '16 09:01 redteam316

The NFP algo would be faster in C, but I'm not sure how much. It's essentially a massive amount of floating point operations, which I assume would optimize pretty well in V8.

Given that my C is pretty rusty, I'm going to say no for now. Might be a project for someone with better knowledge of C perhaps.

Jack000 avatar Jan 22 '16 10:01 Jack000

Speed isn't my main concern in this case because I understand that JS is a beast in its own way (Your demo impressed me, and quite a few others obviously). This should be ported to a library. Leave this issue open perhaps for others to collaborate, express interest and/or make it happen.

redteam316 avatar Jan 22 '16 10:01 redteam316

I agree its very cool. Rather than C++ though, I might attempt a python port using numpy for the matrix work.

Neon22 avatar Jan 22 '16 10:01 Neon22

+1 for Python port. Would be willing to help on that.

rmelly avatar Jan 22 '16 17:01 rmelly

i agree a python or c++ port would be great

antimodular avatar Feb 15 '16 03:02 antimodular

:+1: for CUDA/OpenCL port :smile:

0x2b3bfa0 avatar Feb 15 '16 10:02 0x2b3bfa0

golang anyone? : ]

The only thing unique to this implementation is the No Fit Polygon algo. In C++/Python/Java etc there are much better, mature libraries for path clipping/svg parsing/random geometric functions. I think if someone wanted to write a *lang version of this they'd be better off reading the papers linked in the readme and using the NFP algo in geometryutils.js as inspiration rather than a straight port.

Jack000 avatar Feb 22 '16 12:02 Jack000

Thanks for the pointers Jack. So I've started a related github project at https://github.com/Neon22/inkscape-nest My idea being to integrate it into inkscape as a python extension (plugin) for use in a dedicated SVG environment. I've got a couple of oteh rplugins in the top level rope that I'v ewritten before.

If anyone wants to help out - lets discuss in the Issues over there.

Neon22 avatar Feb 22 '16 22:02 Neon22

@Neon22 Great!

0x2b3bfa0 avatar Feb 23 '16 15:02 0x2b3bfa0

Looking forward to it!

servant74 avatar Feb 23 '16 16:02 servant74

@servant74, @crushedice2000, @antimodular, @rmelly - care to come over and join me ?

Neon22 avatar Feb 24 '16 06:02 Neon22

+1 for some sort of command-line implementation.

mpkogli avatar May 18 '16 01:05 mpkogli

I'm working on porting it to C++: https://github.com/kallaballa/nestcpp/blob/master/src/util/geometry_util.cpp

At the moment i'm translating one function after the other. Anyone wants to join the effort?

kallaballa avatar Jan 18 '18 12:01 kallaballa

i stopped trying to port the javascript and started to implement the approach from bottom up following the papers. i started with the implementation of no-fit polygons: https://github.com/kallaballa/libnfp

kallaballa avatar Feb 01 '18 09:02 kallaballa

@kallaballa , I'm interested in the translation of svgnest with C++

jjqcat avatar Sep 20 '18 13:09 jjqcat

Recently, I implemented multi threaded rectangular layout in the C++environment, but there are several defects on the motherboard. It can be arranged once in about 100 seconds

C++wrote the core layout section, and used Python for the genetic algorithm section

I am planning to write a C++version of polygon layout, preferably to support the presence of voids in the board and the presence of voids on the motherboard. I have a very clever idea of dropping parts into the motherboard from above at a specific angle and position

guanquanchen avatar Sep 18 '23 08:09 guanquanchen

Have their been any developments in this space? I have not had any success with the CLI forks for deepnest.

PoorRican avatar Jan 12 '24 00:01 PoorRican

No progress, there is currently no C++version available

guanquanchen avatar Feb 07 '24 08:02 guanquanchen