-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remesh example? #20
Comments
You need to provide some member functions in the vert and tri data structs, but I don't remember which off the top of my head. The compiler will yell at you until they're all there. You can also look at my toptop code, which uses the same underlying data structures. -- Gilbert
|
Thanks! So, something like:
When I add this to my (vs2012) project I get a bunch of LNK2005 errors,,, Have you run in to this before? Might just be a windows thing... |
To clarify, just defining these structs generates the error - the code compiled fine before. |
Since a lot of the code is template code, that’s unsurprising that adding the structs could cause an error. I’m not sure what’s going wrong from the errors you posted. It looks like it’s complaining about having the << operator not be defined. However, I’d guess that this is more likely an issue with how you’re using the template system. Unfortunately C++ is quite finicky about how templates interact with object files. You might have defined something twice and then are getting name conflicts at link time. But again, it’s hard to say. — Gilbert On May 5, 2015, at 3:27 PM, danhambleton [email protected] wrote:
|
I actually get this error simply by including mesh.h in the wincork main... Full error here:
I don't have much experience with templates so I'm at a bit of a loss! I'll read through the toptop code a bit more carefully... |
Look at this part of the error:
|
I understand the gist of the error and am totally fine with working away on my own on this (i.e. this is open source code and you probably don't want to be answering these questions!). However, I'm literally just including your mesh.h in the wincork main and getting that linker error - is this expected behaviour? Anyway, thanks for your time so far! |
Ok, here’s the quick simple answer from scanning the library (haven’t looked at the code in a while) Notice the following include structure: cork.cpp main.cpp This is because I was trying to create a C-friendly interface for the library. Effectively cork.h/cork.cpp implement that wrapper and main.cpp just implements a simple command-line tool interface to the library. The problem you’re having if you include mesh.h in main.cpp is that you’ve now included mesh.h (which is really an enormous chunk of the library thanks to templates having to be entirely in headers) in two different .cpp files. Each of those .cpp files is getting compiled into a .o file and then those are getting linked together. To reiterate, the problem is that you’re compiling two separate versions of the Mesh type. FIX: you can fix this by working with mesh.h from cork.cpp, or if you have your own project, you can use cork.h/cork.cpp as an example for how you should implement your own wrapper around the CPP cork library interface. Make sure mesh.h is only included in this one .cpp file for the wrapper. Ok, here’s the more precision fix after looking in a bit more detail. The TopoTri, TopoEdge etc. operator<< functions are defined in a header (mesh.topocache.tpp) and so the problem is that you’re getting two copies of those symbols. You might be able to fix that by just changing those functions to have the ‘static inline’ keywords, which is a standard workaround to the problem of having functions defined in header files… (I could be wrong about that) I can’t promise that the precision fix will fix everything. — Gilbert On May 6, 2015, at 2:38 PM, danhambleton [email protected] wrote:
|
Thanks! This is exactly what I needed. |
@danhambleton, do you mind sharing your lines for the remeshing work? just want to get some ideas how to apply the remesh feature after a boolean operation. thanks! |
@danhambleton , your example is something I really need right now. Shame you didn't include it. |
Funny thing - I actually spend last 2 weeks trying to recreate mesh library JUST TO GET THIS REMESH OPTION YOU DID NOT GIVE US, @danhambleton . |
FYI, the remesh function is now exposed in my fork as |
Hi there,
I was wondering how to use the remesh functions (or in general, how to interact with mesh.h) - is there some example code I could take a look at? Ideally, I would like to input a .off file and have it remesh based min/max edge length.
Do I need to implement my own VertData and TriData stucts? It looks like there are some conditions that need these need to satisfy, but I'm not sure what exactly they are.
Any help is most appreciated!
The text was updated successfully, but these errors were encountered: