tamasmeszaros / libnest2d

2D irregular bin packaging and nesting library written in modern C++
GNU Lesser General Public License v3.0
314 stars 102 forks source link

Issue with Building Project and Executing Example #3

Open codeplusplusplus opened 5 years ago

codeplusplusplus commented 5 years ago

Hi,

I executed the "cmake ." "make" and "sudo make install" command. A bunch of clipper and nlopt folders were created. Boost was already installed so no new folders for the boost source.

I then switched to the examples folder and executed the "g++ -I../include -I../clipper_library-src -I../nlopt-src main.cpp" command.

The consol outputs a bunch of errors: "In file included from main.cpp:7: ../include/libnest2d.h:25:15: error: ‘PointImpl’ does not name a type; did you mean ‘PointType’? using Point = PointImpl; ^~~~~ PointType ../include/libnest2d.h:26:22: error: ‘PointImpl’ was not declared in this scope using Coord = TCoord; " Could someone help me in the execution of the example?

tamasmeszaros commented 5 years ago

Hi @codeplusplusplus

subhashreehari commented 5 years ago

Hi @tamasmeszaros , I executed the code using windows with the available vector points in libnest2d/tests/printer_parts.cpp I need to execute for the same with my input objects, I tried using with the vector points for my object but the objects were overlapping. Is there any criteria to be followed while converting the object to vector points.

can you please help in fixing this!

Thanks!

tamasmeszaros commented 5 years ago

Hello, is it possible that your points represent a non-convex polygon? At this point the nesting works only with convex polygons which have to be in clockwise order and the last point should be the same as the first point. No checks are performed so you have to ensure these requirements manually.

I would suggest calling libnest2d::sl::convexHull on your polygon which should return a proper polygon for nesting.

subhashreehari commented 5 years ago

Hi @tamasmeszaros , The issue got solved! Thanks for your timely response. I am looking for non-convex polygon- Nesting. Can you suggest a way to solve this.

Thankyou!

tamasmeszaros commented 5 years ago

@subhashreehari I would like to say that non-convex nesting will be ready soon but I can't. What is sure that at some point it will make it into libnest2d. Until then, there is a great project SVGNest written in Javascript, or Deepnest which should have some C++ written backend to SVGNest. Another great project in C++ is Plater if you are looking for nesting 3D objects on a 2D bed. If none of these open source solutions suit your needs, there are commercial projects which you can use, like Nestprofessor

subhashreehari commented 5 years ago

@tamasmeszaros Ok, will try those. Thankyou for the reply!

subhashreehari commented 5 years ago

@tamasmeszaros I was able to get the rotation angle of the object in final output but there is a change in visual observance in .svg file and value of the angle. which angle should i consider. can you please share your valuable comment!

Thankyou!

tamasmeszaros commented 5 years ago

@subhashreehari I'm not sure if I get the context here. Can you explain the problem in a bit more detail? Do you consider the angles in the right measure? They should be radians in every case. Which angles are we talking about? Are those the angles carried by the Item objects?

subhashreehari commented 5 years ago

@tamasmeszaros Yes, I am asking about angles carried by Item objects. Using Item objects transformed shape, the output is written in SVG file format. The angle returned by the Item object and the placement of SVG object-orientation is different. Let's say, Item object angle is 180 degree ( I'm converting radians to a degree) and it is placed in SVG as 0 degrees and vice-versa. Please provide your comments on it.