Giter VIP home page Giter VIP logo

Comments (8)

kallaballa avatar kallaballa commented on June 3, 2024

Absolutely. Check out

    p.inners().push_back
    p.outer().push_back

from libnfporb.

petrasvestartas avatar petrasvestartas commented on June 3, 2024

Thank you for both replies.
I am trying to test simple setup when initial polygon is simple rectangle and other element is triangle.
The app builds corrections but it only outputs two points (-10,0) and (0,0). Which is not a polygon.
Probably I am making very simple mistake. Here is the code:

#include "pch.h"
#include <iostream>
#include "libnfporb.h"



int main()
{
	using namespace libnfporb;
	using namespace std;

	polygon_t pA ;
	polygon_t pB;

	//polygon_t::ring_type outerRing;

	//Quad
	const point_t p0(0, 0);
	const point_t p1(10, 0);
	const point_t p2(10, 10);
	const point_t p3(0, 10);

	pA.outer().push_back(p0);
	pA.outer().push_back(p1);
	pA.outer().push_back(p2);
	pA.outer().push_back(p3);
	pA.outer().push_back(p0);

	//Triangle
	const point_t p4(0, 0);
	const point_t p5(10, 0);
	const point_t p6(10, 10);

	pB.outer().push_back(p4);
	pB.outer().push_back(p5);
	pB.outer().push_back(p6);
	pB.outer().push_back(p4);

	nfp_t nfp = generateNFP(pA, pB, true);
	
	for (auto v : nfp) {
		
		for (auto vv : v) {
			cout << vv.x_;
			cout << " ";
			cout << vv.y_ << endl;
		}
	}

}


from libnfporb.

kallaballa avatar kallaballa commented on June 3, 2024

Could you please try to add

#define LIBNFP_USE_RATIONAL

before including the header and try again?

from libnfporb.

petrasvestartas avatar petrasvestartas commented on June 3, 2024

I still have the same issue and output is the same:

Is there any possibility to get one fully working example file without wkt?

issue

from libnfporb.

Papooch avatar Papooch commented on June 3, 2024

I am having the same issue! See: #19 for details.
Also when I add #define LIBNFP_USE_RATIONAL, I get the following
error: fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory

from libnfporb.

kallaballa avatar kallaballa commented on June 3, 2024

I still have the same issue and output is the same:

Is there any possibility to get one fully working example file without wkt?

Sorry for the long wait. I am on it

from libnfporb.

kallaballa avatar kallaballa commented on June 3, 2024

I am having the same issue! See: #19 for details.
Also when I add #define LIBNFP_USE_RATIONAL, I get the following
error: fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory

you need to install libgmp but i ruled out that LIBNFP_USE_RATIONAL does fix the problem.

from libnfporb.

kallaballa avatar kallaballa commented on June 3, 2024

I found the problem. In certain cases the translation vector was trimmed to zero. fixed: ea26404

from libnfporb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.