GithubHelp home page GithubHelp logo

gammaunc / pqp Goto Github PK

View Code? Open in Web Editor NEW
63.0 63.0 13.0 317 KB

A library for performing proximity queries on a pair of geometric models composed of triangles

License: Other

Makefile 0.47% Objective-C 38.42% C++ 50.05% C 7.99% CMake 3.07%

pqp's People

Contributors

mokosha avatar rickertm avatar tobiaskohlbau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pqp's Issues

Distance between scaled models

the RectDist function calculates distance considering relative rotation & translation between two rectangles. If both of these rectangles are scaled (transformation has scale factor along with rotation and translation) how will this be modified ?

Wrong result from TriDist

I have encountered a bug where TriDist returns the wrong result.

The sample code below outlines the issue:

#include <stdio.h>
#include <math.h>
#include "PQP.h"

int main()
{
PQP_Model *b1 = new PQP_Model;
PQP_Model *b2 = new PQP_Model;

PQP_REAL triangleS[3][3] = {
                 {8000.0000000000036,
                  6817.7672478170962,
                  571.00166381103077},
                 {7500.0000000000009,
                  6817.7672478170962,
                  571.00166381103077},
                 {7500.0000000000009,
                  6327.6345143037688,
                  571.00166381103077} };

PQP_REAL triangleT[3][3] = {
           {8000.0000000000009,
            6327.6345143037670,
            88.336618780016408},
           {7500.0,
            6327.6345143037670,
            88.336618780016408},
           {7500.0,
            6327.6345143037670,
            1015.9309593449836} };

b1->BeginModel();
b2->BeginModel();

b1->AddTri(triangleS[0], triangleS[1], triangleS[2], 0);
b2->AddTri(triangleT[0], triangleT[1], triangleT[2], 0);

b1->EndModel();
b2->EndModel();

PQP_REAL R1[3][3], R2[3][3], T1[3], T2[3];

R1[0][0] = R1[1][1] = R1[2][2] = 1.0;
R1[0][1] = R1[1][0] = R1[2][0] = 0.0;
R1[0][2] = R1[1][2] = R1[2][1] = 0.0;

R2[0][0] = R2[1][1] = R2[2][2] = 1.0;
R2[0][1] = R2[1][0] = R2[2][0] = 0.0;
R2[0][2] = R2[1][2] = R2[2][1] = 0.0;

T1[0] = 0.0;  T1[1] = 0.0; T1[2] = 0.0;
T2[0] = 0.0;  T2[1] = 0.0; T2[2] = 0.0;

PQP_DistanceResult dres;
PQP_Distance(&dres, R1, T1, b1, R2, T2, b2, 0.0, 0.0);

//dres.distance = 687.89217334989303
//but it should be:
//dres.distance = 1.8189894035458565e-12

delete b1;
delete b2;

return 0;

}

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.