|Date:||23 Jul, 2016|
this is a wrapper for TetGen (www.tetgen.org) by Hang Si, Weierstrass Institute for Applied Analysis and Stochastics (WIAS);
A Quality Tetrahedral Mesh Generator and a 3D Delaunay Triangulator
TetGen generates tetrahedral (volumetric) meshes and 3d delaunay triangulations from PLC's (piecewise linear complexes), which essentially are sets of 2d polygons describing the boundaries/hull/surface of a 3d geometry. These polygons are given by their corner points plus indices (in clockwise or counter-clockwise order).
The resulting data (points plus triangular indices) can be used to create a mesh in vvvv. For volume-dependent calculations (my actual use case;)) tetrahedral indices will be output too.
Holes and regions (with differing meshing quality/density) are supported. The 'r' switch (refining existing tetrahedral meshes) is not supported by this plugin. Optionally input and output files can be written to disk (.poly,.node,.ele,.face, see here), see Inspector for options.
Fully spreadable, with helpfile(s).
All information on TetGen can be found here: www.tetgen.org
All switches, which are needed to control the behaviour of TetGen, ie the meshing quality/density, can be found here: http://wias-berlin.de/software/tetgen/switches.html
(reminder to myself)
- file reader for .poly,.node,.ele,.face files
- support the 'r' switch
- improve RemovRegions performance, no good
- support point metrics, point attributes (tried nut no luck), facet constraints, segment constraints, etc.
- run TetGen on a different process to avoid blocking of vvvv (meshing simple geometries might even work in realtime...)
- normals in dx11 (?)
- check if spreading actually works ;)
As I always struggle (again) to find out eg how Interop between C++ and C# works (and a lot of other plugin related stuff) I'm sharing the full source code here. Be aware, no guarantee any of this is done the way it actually should be done (especially don't copy any of my nuget, addonpack or compiler related settings: i have no idea :)....all input welcome of course!
- the source code for the unmanaged "TetGen2vvv.dll", which itself calls "tet.lib"(included, compiled with TetGen v1.5 from www.tetgen.org), can be found here: https://github.com/digitalwannabe/TetGen4vvvv
- the source code for the vvvv plugin, which calls the unmanaged "TetGen2vvvv.dll" can be found in my addonpack fork: https://github.com/digitalwannabe/vvvv-sdk/tree/develop/vvvv45/addonpack/src/nodes/plugins/3d/3dTetrahedralize
All my code is MIT where possible TetGen is licensed under AGPLv3, find info on licensing TetGen here
v1.03 : -new input: vertex marker -new outputs: vertex markers, face markers, region attributes, tetrahedron neighbors -new helper node: RemoveRegion, with helpfile. needs performance improvement though
v1.02 : compiled with /MT to support older vs
v1.01 : -bug fixes
v1.0 : -initial release
Always copy the dependencies folder (+helpfiles) with the plugin!
CommentsComments are no longer accepted.
Please create a new topic in the vvvv beta forum to discuss this contribution.
Hi :) Super curious to get it working, but it doesnt find the DLL
hi, do you have the dependencies folder next to the 3dTetrahedralize,dll?
err, sorry, my fault, should be ok now, please try again.
Sorry but still the same error. Is there anything i can try out? Im on beta34.2 64bit
tbh I haven't tested it on another machine before and there has been some path issues, however, just tested the recent version on another machine and it's working fine, also with b34.2_64....so something else seems to be the problem here...anything else TTY is saying? you can try copying the TetGen2vvv.dll in dependencies/x64 (as you're running 64 bit) to your vvvv directory, next to vvvv.exe, and also try next to 3dTetrahedralize.dll..... Please let me know if that's changing anything, unfortunately I'm not able to reproduce the error in order to provide more help.....anybody else got the same problems?
@tekcor: any luck? anybody else having problems?
yes. got tekcors problem as well. can´t find dll. will try your proposed strategy.
hm, very strange. tested it today on 2 other devices without a problem....is TTY saying anything else? please confirm it doesn't work applying this order (which is what I do): -download plugin and unpack -start vvvv b34.2 x86 or x64 -drag and drop 3dTetrahedralize.dll node in the patch -select the node and hit F1 -a triangulated box should be visible now in the renderer
Not working for me, tried everything you listed above, no red nodes but console message that it can't find TetGen2vvvv.dll. This is with 34.2_x64 on Win7 Enterprise x64.
Hmmm, depends.exe shows the file 3dTetrahedralize.dll as an x86 DLL, and gives the error "Modules with different CPU types were found".
So are you sure you've tried it and it works on x64?
yes, tried x86 and x64 on different systems, however, not on windows 7....@tekcor @sinus are you on win7 too? can't see a reason why it shouldn't work on win7, but I don't see any other reason atm either :(
It seems to be some mistake I've done with compiling, very likely as this is one of my first plugins I've precompiled which depends on another c++ library; maybe one of the devs can have a look, as far as I can tell I've followed all available instructions closely..... anyway, to get around errors I might have done with precompiling please try downloading the plugin source folder (link above) and drop the csproj file in your patch. The according Tetgen2vvvv.dll(x64 or x86) should lie next to vvvv.exe (x64 or x86) for this to work.
i work on win7, beta 34.2. 64 bit. thx for your efforts!
good news is it's not win7, as bad news i found a windows 10 pc where it's not working either....or maybe that's the good news, we will see....anyway, won't have access to that pc immediately but i'll try to figure this out asap. anybody else having troubles please report!
yes i am on windows 10. sorry didnt have time to make further tests yet but still hot topic :)
hm...got access to that computer but no good news unfortunately; tried a lot of stuff, no luck. will do a forum post....
@tekcor @sinus @mediadog @anybody else having problems: if any of you can confirm that running the helppatch of spoutcontrols and hit write will NOT create a folder C:\ProgramData\Spout and a txt file in it + you do get the same TTY error this could help a lot in tracking down what's wrong. Atm I believe that for some reason the path to the referenced dlls is not added (correctly) to your PATH environment variables....I'm working on finding a solution.
@everybody who had problems, please try again- it is now working on the system I have access to, please confirm!
Works with both 34.2 x86 and x64! w00t!
However, I do get a "vvvv.exe has stopped working" on exiting though; with x86 it happens with all three patches, on x64 the help patch exits OK but the two facet patches crash on exit. So makes me think there is some memory splatter in there somewhere.
But hey, I can try it out now! Thanks @digitalwannabe!
Hm ok, thanks for the info! Will try to see what's wrong....biggest problem will again be reproducing it, as I had no crashes yet, also not on the system which didn't work before. Anybody else having a crash on shutdown?
Workaround for now would be saving the computed data into a file and load this in your production patch- as in most cases TetGen won't work in realtime you shouldn't need the node in your final patch. I also intend to do read/write nodes at some point, might take a while until I can work on that though.....