Jack000 / SVGnest

An open source vector nesting tool
MIT License
2.27k stars 378 forks source link

Plans on porting to C/C++ ? #6

Open redteam316 opened 8 years ago

redteam316 commented 8 years ago

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

Jack000 commented 8 years ago

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.

redteam316 commented 8 years ago

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.

Neon22 commented 8 years ago

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

rmelly commented 8 years ago

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

antimodular commented 8 years ago

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

0x2b3bfa0 commented 8 years ago

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

Jack000 commented 8 years ago

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.

Neon22 commented 8 years ago

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.

0x2b3bfa0 commented 8 years ago

@Neon22 Great!

servant74 commented 8 years ago

Looking forward to it!

Neon22 commented 8 years ago

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

mpkogli commented 8 years ago

+1 for some sort of command-line implementation.

kallaballa commented 6 years ago

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 commented 6 years ago

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

jjqcat commented 6 years ago

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

guanquanchen commented 1 year ago

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

PoorRican commented 8 months ago

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

guanquanchen commented 8 months ago

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