Git Product home page Git Product logo

geodesic's People

Contributors

mojocorp 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

Watchers

 avatar  avatar  avatar

geodesic's Issues

Run it with python

Hi,
Can I ask you for some support running the code from python 2.7 on Windows 10?
After opening it in cmake and trying to configure it I get following problem:

Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE

Regards,
Dado

how to use this tool?

can you provide an example of how to use this tool? An example of how to generate the geodesic distance given a source point, a target point, and the reference mesh? Thank you so much for your patience.

Just a little python script to convert to your format from .obj

import sys
import re

def run (argv):
    path = argv[1]

    with open(path) as f:
        vertices = []
        faces = []
        for line in f.readlines():
            vmatch =  re.search("^v\s*(-?\d+.\d+)\s*(-?\d+.\d+)\s*(-?\d+.\d+)\s*", line)
            if vmatch != None:
                groups = vmatch.groups()
                vertices.append(groups)
            
            fmatch = re.search("^f\s+(\d+)/\d*/\d*\s+(\d+)/\d*/\d*\s+(\d+)/\d*/\d*\s*\n", line)
            if fmatch != None:
                groups = fmatch.groups()
                faces.append(groups)
        res = str(len(vertices)) + " " + str(len(faces))+ '\n'
        for x, y, z in vertices:
            res += x + "\t" + y + "\t" + z + "\n"

        for v1, v2, v3 in faces:
            
            v1 = int(v1) -1
            v2 = int(v2) -1
            v3 = int(v3) -1
            res += str(v1) + "\t" + str(v2) + "\t" + str(v3) + "\n"

        print(res)

if __name__ == "__main__":
    run(sys.argv)

Propogate does not stop at target vertices

I don't think the stopping criteria work for target vertices. The max distance works fine but providing target vertices and a max_dist of 1e100 causes a full search of the mesh.
Maybe this is an indexing/pointer issue?

Define external target points (not mesh vertices)

Hello,

I would like to know if it would be possible to define input target (and source points, for building path), wichi are not vertices of the input mesh (in the middle of a mesh facet for example) ?
I have a code that can project given 'external' points (XYZ) on the input mesh, and I would let like ot reuse them for building shortest path.
Is it possible today ?

Thank you
Yvan

Memory cumulative increase when Iterative use propagate&trace_back

for my requirement,I have to iterative use function propagate&trace_back then I find that memory
increase quickly.
I show part of my code below:
`
void geodesicPathFinder::initMesh(vector points, vector faces, int num){
mesh.initialize_mesh_data(points, faces);
subFinders.resize(num);
boundaries.resize(num);
}
void geodesicPathFinder::testMem(int start_vIdx, int end_vIdx){
geodesic::GeodesicAlgorithmExact algorithm(&mesh);
vectorgeodesic::SurfacePoint path;

geodesic::SurfacePoint source(&mesh.vertices()[start_vIdx]);
vector<geodesic::SurfacePoint> all_source(1, source);
geodesic::SurfacePoint traget(&mesh.vertices()[end_vIdx]);
vector<geodesic::SurfacePoint> stop_points(1, traget);
algorithm.propagate(all_source, geodesic::GEODESIC_INF, &stop_points);
algorithm.trace_back(traget, path);
algorithm.clear();

}
`
and where for those function testing:

` void pathFinderTest(){
const float TEST_TIME = 1000.0f;
float interval = 1.0f / TEST_TIME;
const int DEBUG_CONTOUR = 3;
vector vertexList(mesh.n_vertices() * 3);
for (int i = 0; i < mesh.n_vertices(); i++)
{
OpenMesh::VertexHandle v(i);
OpenMesh::Vec3f pos = mesh.point(v);
vertexList[i * 3 + 0] = pos[0];
vertexList[i * 3 + 1] = pos[1];
vertexList[i * 3 + 2] = pos[2];
}
vector faceList(mesh.n_faces() * 3);
for (int i = 0; i < mesh.n_faces(); i++){
OpenMesh::FaceHandle f(i);
int num = 0;
for (MyMesh::FaceVertexCWIter fv_cwit = mesh.fv_cwbegin(f); fv_cwit != mesh.fv_cwend(f); fv_cwit++)
{
faceList[i * 3 + num++] = (*fv_cwit).idx();
}
}

	for (int i = 0; i < TEST_TIME; i++){
		geodesicPathFinder *finder = new geodesicPathFinder();
		finder->initMesh(vertexList, faceList, pMap->contours->size());
		finder->testMem(1147, 1444);
		delete finder;

		cout << "i=" << i << "完成   ";
	}
}`

As you can see I use clear() but it dosent work. the cost of memory keep increase even after I delete geodesicPathFinder object every iteration ,whats more variable algorithm is a local variable,which should be destroy after the function is over.
it cost too much memory,it cost 1GB after 100 iteration!
I don`t know what wrong in those code,or I just make some mistake in using your codes,
can you give me some help ,thanks!

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.