mlivesu / cinolib Goto Github PK
View Code? Open in Web Editor NEWA generic programming header only C++ library for processing polygonal and polyhedral meshes
License: MIT License
A generic programming header only C++ library for processing polygonal and polyhedral meshes
License: MIT License
Files predicates.h/cpp
Functions
double orient2d(const double * pa, const double * pb, const double * pc);
double orient3d(const double * pa, const double * pb, const double * pc, const double * pd);
are implemented if and only if CINOLIB_USES_EXACT_PREDICATES are not defined.
If CINOLIB_USES_EXACT_PREDICATES is defined, building errors occur : Undefined reference to orient2d' /
orient3d'.
Having a 3D triangular surface mesh is it possible to offset it by a specified distance preserving its sharp edges with cinolib?
I cannot find a CMakeLists.txt under cinolib to cmake/make and thus cannot build examples. How to generate **so and *.a of the cinolib? Thanks.
@mlivesu I think we should supply an option swifting between perspective and orthographic. Orthographic is mostly used in Engineer and CAD/CAE. What about you?
like cinolib we could have more interfaces for CAX software, if we have interfaces, comments and the books, if we use nanogpt, maybe we could train an AI assistant?
Hello,
This repository was suggested to me by github and I just read the readme.
Looking at your research oriented list of mesh libraries, I wanted to suggest you CGOGN_2 and CGoGN_3 as "unified data structure for multiple dimension handling".
In fact, these libraries implement a mesh data structure (based on a theoretical model) that can handle 0D, 1D, 2D and 3D oriented open or closed manifolds whatever their discretization (polygons or polyhedrons). There is also a cgal package based on the same theoretical data model that can handle nD objects. A while ago we made some benchmarks also.
Reading your paper Optimal Dual Schemes for Adaptive Grid Based Hexmeshing, it mentions that it's implemented in cinolib (in hex_transition_schemes.h), but does cinolib come "with batteries included" for obtaining a fully automatic hexmesh from, for example, a trimesh stored in OBJ? I'm asking this question because I found the repository used for the paper (https://github.com/cg3hci/Gen-Adapt-Ref-for-Hexmeshing) but however that code has quite a few external dependencies that I'd like to avoid.
If cinolib has all the necessary stuff, can you show some example for hexmeshing a triangle mesh? (I suppose the first step would be generating an adaptive grid, but that can be done with cinolib as well, can't it?
Hi, I would like to cut a volume mesh based a level set embedded on its vertices (at isovalue zero). To do so I have tried implementing it as seem bellow. While it compiles and runs without issues the mesh is not being split. I am probably missing something pretty trivial but I can’t seem figure out what it is. Hopefully you can shed some light on it.
std::vector<double> isovalues;
for (uint vid=1; vid<MyTetMesh.num_verts(); ++vid) {
// Get coordinates of current point
vec3d point = MyTetMesh.vert(vid);
Point p(point.x(), point.y(), point.z());
// Compute isovalue for current point
double isovalue = my_function(p);
isovalues.push_back(isovalue);
}
// Copy the field on the mesh?
ScalarField f = ScalarField(isovalues);
f.copy_to_mesh(MyTetMesh);
// Slice the mesh?
MeshSlicer ss;
ss.Z_thresh = 0;
ss.slice(MyTetMesh);
it seems many intersections when I slicing a .mesh file using 05_hexmesh_viewer
bunny_projected.zip
I want to achieve a simple subdivision schme on hexmesh. I think the ‘'hex_transition_install’' function may help me a lot.But i don't know which verts should be set to true in transition_verts. Is there any examples?
Hi, Is there a build in way to save surface as an .stl file with its normals oriented outwards?
I've compiled cinolub successfuly,but ImGUI control cannot be visible,What's wrong? other is OK
Havig two two sided textured OBJs, how one would be capable to merge and substract one from another combining textures in a new surface object? #
Win10, Qt5.10, vs2017, 02_base_app_quadmesh.pro
There are lots of compile error about GL.h(Windows Kits\10\Include\10.0.17134.0\um\gl\GL.h), I think it is a question.
Hello,
The most important example (remesher) fails:
22_remesher.pro main.cpp main.o Makefile remesher
csverma@blackhole:$ ./remesher ~/Disk/DataSets/Chair.off
new mesh 147428V / 444576E / 296384P
388249 edges longer than 0.0430667 were split.
142714 edges shorter than 0.02584 were collapsed.
250670 edge flip were performed to normalize vertex valence to 6
tangential smoothing
Remesh iteration [10.939885s]
1122279 edges longer than 0.0430667 were split.
231838 edges shorter than 0.02584 were collapsed.
remesher: ../../include/cinolib/meshes/abstract_polygonmesh.cpp:1347: uint cinolib::AbstractPolygonMesh<M, V, E, P>::poly_add(const std::vector<unsigned int, std::allocator >&) [with M = cinolib::Mesh_std_attributes; V = cinolib::Vert_std_attributes; E = cinolib::Edge_std_attributes; P = cinolib::Polygon_std_attributes; uint = unsigned int]: Assertion `poly_id(vlist)==-1' failed.
Aborted (core dumped)
Hi,
When I try to compile LoopyCuts, I got a error from cinolib, the error is shown blow.
In file included from ./definitions.h:30: In file included from ../lib/cinolib/include/cinolib/meshes/meshes.h:49: In file included from ../lib/cinolib/include/cinolib/meshes/hexmesh.h:124: ../lib/cinolib/include/cinolib/meshes/hexmesh.cpp:405:19: error: no member named 'update_hex_quality' in 'cinolib::Hexmesh<cinolib::Mesh_std_attributes, MV, ME, MF, MP>' this->update_hex_quality(pid); ~~~~ ^ export_helper.cpp:37:12: note: in instantiation of member function 'cinolib::Hexmesh<cinolib::Mesh_std_attributes, MV, ME, MF, MP>::poly_fix_orientation' requested here hm.poly_fix_orientation(); // meta mesh does not have globally consistent winding numbers... ^ In file included from export_helper.cpp:27: In file included from ./export_helper.h:30: In file included from ./state.h:36: In file included from ./definitions.h:30: In file included from ../lib/cinolib/include/cinolib/meshes/meshes.h:49: In file included from ../lib/cinolib/include/cinolib/meshes/hexmesh.h:124: ../lib/cinolib/include/cinolib/meshes/hexmesh.cpp:415:19: error: no member named 'update_hex_quality' in 'cinolib::Hexmesh<cinolib::Mesh_std_attributes, MV, ME, MF, MP>' this->update_hex_quality(); ~~~~ ^ 21 warnings and 2 errors generated. make: *** [export_helper.o] Error 1
I tried to search the function in 3D5378, But I can not find this function.
Any suggestion?
Thank you.
Thanks for putting this great library together @mlivesu!
I'm trying to adopt it to terrain modelling applications where curve-based mesh manipulation is a common task.
Consider this example. Given a terrain mesh and a curve in arbitrary 3d space:
Embed the curve into the mesh:
Do you have any suggestions on how to approach it?
Hello Marco,
How can we store the colors painted on a model using surface_painter tool?
Regards
hi,I am trying to implement the QEM with cinolib, here is my question
I stored vid pair to collapse in the priority queue like this
struct contract {
double cost, x, y, z;
unit vid1, vid2;
}
I noticed that when deleting elements, the switch_id
function will execute, causing the element id switch with last id, rendering the contract
operation related to the last vid invalid. How can i solve this problem
Hello,
Do you think it would be possible to add soft shadows effects to the rendering system of Cinolib viewer ? Or do we have to send request to glfw ?
thank you.
hi, I have test the "heat_geodesics" example. It is awesome!
I want plot the vector field on the mesh.
In the function “compute_geodesics”, it tells us the final result of the geodesics, which was copied to the mesh by the function of “copy_to_mesh”. Then the mesh object, which is inherited from the DrawableObject class, is plotted by the GLcanvas object.
Motivated by this mechanism, I’ve noticed that there is a module called “drawable_vector_field”, which is defined by the “drawable_vector_field.h” and “drawable_vector_field.cpp”. And the drawable_vector_field class also is inherited from the DrawableObject class. Does that mean the drawable_vector_field object could be pushed into the GLcanvas and show the drawable_vector_field.
Furthermore, in the function “compute_geodesics”, “VectorField grad = G * heat”. The “grad” object is a “VectorField”, which actually is a Eigen::VectorXd. And the drawable_vector_field has a constructor called DrawableVectorField(const Eigen::MatrixBase& other) : Eigen::VectorXd(other) .So, is it possible to plot the VectorField grad by the drawable_vector_field on the mesh?
Thank you very much!
Hi, I would like to use remesh_Botsch_Kobbelt_2004 to remesh a surface using the api. The issue I am having is that remesh_Botsch_Kobbelt_2004 seems to require a DrawableTrimesh which in turn is dependent on gl (my understanding is that gl is required for the GUI stuff, which I am not interested in). Is there a way of using remesh_Botsch_Kobbelt_2004 without needing gl?
Hello,
thank you very much for your tremendous work on this library!
Would it be possible to add support for semantic versioning?
I know that there is the 1.0
tag. However, it seems to be out of date.
I tried using hex_transition_install. It seems the function calls 'transform' and 'bake_rotation_matrix' in hex_transition_orient.cpp are not defined.
Hello,
i would like to compute the covered area by a triangle mesh A on a second mesh B (made of either triangles or quads). Expected output is the covering ratio for each mesh B element.
I was wondering of your shadow casting (OpenGL) could be used for that need, and if yes how ?
thank you
First of all, thank you for this great project! It spared me a lot of trouble during my research.
I was investigating the duality of the meshes from the example 13, m_tet
and m_poly
.
I observed every edge from the m_tet
mesh and its corresponding face from the m_poly
mesh (shared face between edge points). I realized that:
Is that a desired behaviour? Am I doing it wrong?
This is the code snippet I inserted into the example code for the purpose of this analysis:
for (int i=0; i<m_tet.num_edges(); ++i)
{
std::vector<uint> vert_ids = m_tet.edge_vert_ids(i);
uint fid = m_poly.poly_shared_face(vert_ids.at(0), vert_ids.at(1));
std::vector<vec3d> edgev = m_tet.edge_verts(i);
std::vector<vec3d> facev = m_poly.face_verts(fid);
std::ofstream edgeout ("/tmp/cino/edge-" + std::to_string(i) + ".txt");
for (auto v: edgev)
edgeout << v.x() << " " << v.y() << " " << v.z() << "\n";
std::ofstream faceout ("/tmp/cino/face-" + std::to_string(i) + ".txt");
for (auto v: facev)
faceout << v.x() << " " << v.y() << " " << v.z() << "\n";
}
possible to cut mesh with set of 3d points on it.
if possible , example ??
Hello,
While I was able to run most of the example, I am unable to see sharp edges in the example 23. The value on the webpage is set to 60 which I also did (on the same example), but nothing changed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.