Giter Site home page Giter Site logo

valette / acvd Goto Github PK

View Code? Open in Web Editor NEW
215.0 13.0 57.0 656 KB

Fast simplification of 3D surface meshes

Home Page: https://www.creatis.insa-lyon.fr/~valette/public/project/acvd/

License: Other

CMake 1.34% C++ 97.60% Shell 0.09% Python 0.50% JavaScript 0.47%
computer-graphics simplification mesh

acvd's People

Contributors

arnaudgelas avatar kayarre avatar kislinsk avatar rhodanos avatar sercxjo avatar valette avatar wadoon 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

acvd's Issues

ACVD crashes after closing second window

Windows 10, x64 VS2015, Debug

Windows crashes when running ACVD with display on.

repro:

Run ACVD
close first window that pops up
close second window

What is the process for getting a remerged mesh with display enabled. I can't find any docs that describe the steps.

Setting the variable 'Display' to 0 runs without crashing.

Example code usage with data

Thanks for sharing this nice code. I'm new to this tool. I found there are many tools here:

  1. ACVD
  2. ACVDQ
  3. AnisotropicRemeshing
  4. AnisotropicRemeshingQ
  5. ManifoldSimplification
  6. VolumeAnalysis
  7. etc

Can you add few simple tutorials/examples with data in Readme.md to show how to use your codes for each of them? I think hand model and fandisk in your paper are good cases.

I found this Python implementation of ACVD is a good example.

https://github.com/pyvista/pyacvd

This application has requested the Runtime to terminate it in an unusual way.

I try to use ACVD to simplify a 500M obj,this is the command:

ACVD.exe 1.obj 70000 0

and this is the output message:

load : 1.obj
*****************************************************************************
Mesh with 6977920 polygons, 6977922 points, 13955840 edges
The mesh is made of 0 triangles, 6977920 quads and 0 other polygons
0 non-manifold edges and 0 boundary edges
The mesh has 1 connected components
 Valences entropy: 0.0056823
0 disconnected vertices, 6.97792e+006 connected vertices
99.9996 percent of irregular vertices
*****************************************************************************
Input mesh: 6977922 vertices    and     6977920 faces

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Bug fix in ACVDQ

I just found a small bug while comping ACVDQ in windows.

// Line 246 @ ACVDQ.cxx
bool* fixed = new bool[mesh->GetNumberOfPoints()];
//bool fixed[ mesh->GetNumberOfPoints() ]; //Dynamic array should be used here
fixedVertices = vtkIdList::New();
int id, n = 0;

for ( int i = 0; i < mesh->GetNumberOfPoints(); i++ )
    fixed[ i ] = false;

while( input >> id ) {

    n++;
    vtkIdType v1, v2, v3;
    mesh->GetFaceVertices( id, v1, v2, v3 );
    fixed[ v1 ] = fixed[ v2 ] = fixed[ v3 ] = true;

}

for ( int i = 0; i < mesh->GetNumberOfPoints(); i++ )
    if ( fixed[ i ] ) fixedVertices->InsertNextId( i );

input.close();
cout << "Added " << n << " constraints on triangles" << endl;

delete[] fixed; //Free dynamic error
}

Can you check this issue and update your code?

Can't compile code

Have you guys kept your code up to date with the latest releases of VTK? I am getting errors when trying to compile. I noticed the code was released in 2008, so I assume that it hasn't been updated along with changing vtk classes. Let me know if I am correct in assuming this.

Differents results between MacOS et Windows 10

Hello !

I use MacOS X Mojave 10.14.4 and Windows 10 up to date.
In my case, i need to use ACVD for deploy a complex deformable sphere.
I search in this github repository but i did not find anything...
Has anyone ever encountered any differences?

With the same input...

Windows ouput :

Mesh with 3040 polygons, 1522 points, 4560 edges
Bounding Box: [94.6748, 63.8625, -75.726]
[101.292, 70.7261, -66.4477]
The mesh is made only of 3040 triangles
0 non-manifold edges and 0 boundary edges
The mesh has 1 connected components
Valences entropy: 1.64355
0 disconnected vertices, 1522 connected vertices
46.6491 percent of irregular vertices
Mesh geometry qualitity:
AngleMin=24.1465
AverageMinAngle=46.4177
Qmin=0.437835
Qav=0.827767
P30=0.372807

Mac ouput :

Mesh with 3040 polygons, 1522 points, 4560 edges
Bounding Box: [94.6693, 63.8688, -75.7243]
[101.3, 70.7324, -66.4492]
The mesh is made only of 3040 triangles
0 non-manifold edges and 0 boundary edges
The mesh has 1 connected components
Valences entropy: 1.66243
0 disconnected vertices, 1522 connected vertices
47.7004 percent of irregular vertices
Mesh geometry qualitity:
AngleMin=19.2219
AverageMinAngle=46.4299
Qmin=0.312611
Qav=0.827966
P30=0.307018

Regards

random_shuffle deprecated in c++17

In c++17, which is default standard for gcc 11, the random_shuffle function is deprecated : https://en.cppreference.com/w/cpp/algorithm/random_shuffle (this page also gives alternative implementation with random_device which is c++11 compliant)

Only one occurrence is found in the code :

std::random_shuffle( Items, Items + NumberOfRemainingItems );

Note1 gcc still build it but MSVC does not.
Note2 'register' keyword is unused in c++17 and many warnings are thrown

vtkDiscreteRemeshing missing

When I create the solution with cmake it doesn't generate the vtkDiscreteRemeshing project, and when I compile I'm missing vtkDiscreteRemeshing.lib

add regression tests

I think I was able to replace vtkSimpleCriticalSection.h with mutex it compiles but wondered if there is any regression test that we could make to check the code still works the same as before.

[bug report] self-intersection tri after remesh

Hi,

I used ACVDQ to remesh a simple cylinder stl but the output file has self-intersection tris (Tri4 and Tri11).

Tri4: 86 97 20
Tri11: 86 20 74

Here is the log and stl files are attached.

models.zip

ACVDQ.exe RemeshInput_CAVD.stl 1000 0.0 -m 0 -v 0 -b 1 -o F:\PyGeoMesh\Results\ -of RemeshMesh_ACVD.ply
load : F:\PyGeoMesh\Results\RemeshInput_CAVD.stl
*****************************************************************************
Mesh with 1890 polygons, 947 points, 2835 edges
Bounding Box: [320.5, 279.8, 339.5]
              [559.5, 519.504, 490.5] 
The mesh is made only of 1890 triangles
0 non-manifold edges and 0 boundary edges
The mesh has 1 connected components
 Valences entropy: 1.76791
0 disconnected vertices, 947 connected vertices
48.5744 percent of irregular vertices
Mesh geometry qualitity:
  AngleMin=27.9745
  AverageMinAngle=44.9631
  Qmin=0.46611
  Qav=0.806352
  P30=0.15873
*****************************************************************************
Force Manifold=0
Setting output verbose : 0
Setting boundary fixing to : 1
OutputDirectory: F:\PyGeoMesh\Results\
Output file name: RemeshMesh_ACVD.ply
Setting Metric Constraint to 0

Unconstrained initialization done
Setting Metric Constraint to 1
*****************************************************************************
Mesh with 1996 polygons, 1000 points, 2994 edges
Bounding Box: [320.433, 279.8, 339.433]
              [559.554, 519.597, 490.536] 
The mesh is made only of 1996 triangles
0 non-manifold edges and 0 boundary edges
The mesh has 1 connected components
 Valences entropy: 1.68123
0 disconnected vertices, 1000 connected vertices
49.9 percent of irregular vertices
Mesh geometry qualitity:
  AngleMin=14.2918
  AverageMinAngle=45.1805
  Qmin=0.23902
  Qav=0.809694
  P30=0.835003
*****************************************************************************
The remesh took :0.425 seconds.

VTK 7.x removes vtkstd

While trying to compile this project against the latest VTK (v7.1.0), I ran into a compile error with vtkstd being used. It appears that this has been deprecated and should probably be changed to the regular std namespace. Doing so in VolumeProcessing/vtkOOCMetaImageReader.cxx made the build pass again.

Unable to compile on MacOS 10.15 (Catalina) with VTK 9 and Cmake 3.18

Hello, I've come across a slew of compilation errors using the environment described above. Do you guys plan to support these? Example error below.

Thanks,
Omar

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace using ::signbit;

VTK 9 Compilation Error

I am trying to build ACVD using latest VTK 9.0 library.

But when building against vtkSurfaceBase.h , the compiler aborts with errors:

vtkIdType n,*pts;
this->Polys->GetCell(this->Cells->GetCellLocation(face),n,pts);

The error message is:

“GetCellLocation” is not a member of vtkPolyData_detail::CellMap

How may I fix this?

Missing file when compiling

Hello,

I am trying to compile the latest version of ACVD with Visual Studio 2017. However, when I build the solution, I get a lot of the following:

fatal error LNK1181: cannot open input file 'vtkChartsCore.lib'
fatal error LNK1181: cannot open input file '..\..\bin\Release\vtkSurface.lib'
fatal error LNK1181: cannot open input file '..\..\bin\Release\vtkDiscreteRemeshing.lib'

What could be the cause?
Note: I am using VTK 7.1.1

Thanks!

MSVC compiler complains about int to vtkIdType conversion

Hi ACVD developers,

I am building ACVD using VTK 9 using MSVC (16.11.11) from Visual Studio 2019 for x64 architecture and the compilation failed due to the error "int to vtkIdType conversion" on line 119 in vtkVerticesProcessing.h.

It seems like easy fix. I just replace line 118 with
// int NumberOfEdges,*Edges,i;
vtkIdType NumberOfEdges,*Edges,i;

Then, the complication is succesful.

Error in the doc

Hello,
Just a small detail, but on the command line interface, the doc specify :
-d 0/1/2 : enables display (default : 0)
but the real default value is 1.

Should change the default value in DiscreteRemeshing/Examples/ACVD.cxx:60 and DiscreteRemeshing/Examples/ACVDQ.cxx:80, or change the doc in DiscreteRemeshing/Examples/ACVD.cxx:87 and DiscreteRemeshing/Examples/ACVDQ.cxx:103

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.