Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Building Project and Executing Example #3

Open
codeplusplusplus opened this issue Jun 12, 2019 · 9 comments
Open

Issue with Building Project and Executing Example #3

codeplusplusplus opened this issue Jun 12, 2019 · 9 comments

Comments

@codeplusplusplus
Copy link

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
Copy link
Owner

Hi @codeplusplusplus

  • What compiler are you using?
  • Do not call sudo make install, installation is not supported yet.
  • To build with the examples call cmake with -DLIBNEST2D_BUILD_EXAMPLES=ON and then make
  • If you are building on Linux, you can install libnlopt-dev and libpolyclipping-dev to skip downloading them in the config step.

@subhashreehari
Copy link

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
Copy link
Owner

tamasmeszaros commented Jul 22, 2019

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
Copy link

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
Copy link
Owner

@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
Copy link

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

@subhashreehari
Copy link

subhashreehari commented Jul 25, 2019

@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
Copy link
Owner

@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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants