Giter Site home page Giter Site logo

forceflow / trimesh2 Goto Github PK

View Code? Open in Web Editor NEW
293.0 21.0 71.0 775 KB

C++ library and set of utilities for input, output, and basic manipulation of 3D triangle meshes

License: GNU General Public License v2.0

Makefile 0.17% C 53.55% C++ 43.37% POV-Ray SDL 2.91%
graphics transformations manipulation geometry 3d model-manipulation triangle-mesh

trimesh2's Introduction

I'm Jeroen Baert. I write software, mostly for graphics-related applications. I am the developer of libmorton. I'm part of the Nerdland podcast team. I'm most proficient in C/C++, CUDA, Python and Java.

trimesh2's People

Contributors

forceflow 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trimesh2's Issues

Mesh crop into a given box

Hello, I find the function of "MESH crop" is just removing these triangles and vertices outside the box, the boundary of the resulting mesh maybe not get straight along the box...

icp error

Crash occurs when median_dist is 0

Can you explain some datails of the curvature

libsrc/TriMesh_curvature.cc, starting from line 194th:

The following Ax=b would be solved. I just want to know where the left matrix come from? Why is it three rows and three collonms? Thanks.

uu uv 0 x1 dnu*u
0 uu+vv u*v x2 dnuv + dnvu
0 0 v*v x3 dnv*v

Variable corruption crash with ICP

Hi,

When upgrading from 2.14 to 2.15 we got a crash when using the ICP method.
I've build the libs with use of VS 2017.

The crash is located on line 374 of lineqn.h with the exception: Run-Time Check Failure #2 - Stack around the variable 'e' was corrupted.

We are using the default, unmodified version of the Trimesh2 from this Github.

Callstack:
callstack

About the setup

Hi Jeroen,

Thank you for the works.

I am pretty new to Trimesh2. Could you please tell me how to setup trimesh2 in Visual Studio 2015?
(e.g., if I have an empty Win32 console project, what should I do to use trimesh2 features?)

Looking forward to your reply.

Best regards,
Lin

Strange translation results.

Hi Forceflow,

Firstly thank you for the great fork!

I think i've bug in the ICP algorithm.

With certain objects, when they are located over eachother, the translation get messed up, and the resulting transformation matrix will cause the object jump to the other side of the screen.
The resulting rotation matrix is perfect, but it is the translation that is causing trouble.

Its not present in all cases, but in the teeth (which are attached) the phenomenon is present.

What do you think about this?

testset.zip

TriMesh::cornerangle uses incorrect formula for angle from known dot-product.

according to a formula for dot product:
a_vec dot b_vec = a_mod * b_mod * cos(angle_a_b)

TriMesh::cornerangle misses a_mod * b_mod and the code should be:

inline float cornerangle(int i, int j)
{
using namespace ::std;

if (unlikely(faces.empty())) need_faces();
const point &p0 = vertices[faces[i][j]];
const point &p1 = vertices[faces[i][NEXT_MOD3(j)]];
const point &p2 = vertices[faces[i][PREV_MOD3(j)]];

// new lines down from here
const point &v1 = p1 - p0;
const point &v2 = p2 - p0;
const float m = len(v1) * len(v2);
// return line is replaced
return acos(v1.dot(v2) / m);
}

GLCamera::setupGL function

Hi,

I have a question about the GLCamera::setupGL() function. Based on the source code, it returns a projection matrix using:

diag = sqrt(float(sqr(width) + sqr(height)));
top = (float) height/diag * 0.5f*field_of_view * neardist;
bottom = -top;
right = (float) width/diag * 0.5f*field_of_view * neardist;
left = -right;
glFrustum(left, right, bottom, top, neardist, fardist)`.

However, the above calculation of (left, right, bottom, top) seems a bit different to what I have learned below (needs a tangent function):

function perspectiveCameraUsingFrustum (fovy, aspect, near, far) {
  top = near * Math.tan(toRadians(fovy)/2);
  bottom = -top;
  right = top * aspect;
  left = -right;
  return createFrustum(left, right, bottom, top, near, far);
}

Can anyone explain if they are the same or their differences ? Thanks in advance.

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.