Comments (8)
hi @TheNightbringer117, can you give me a short example how I can produce this issue?
it is actually quite common that tetgen fails if a user does not process the input surface carefully - mostly because your input surface is self-intersecting. If it is a single closed surface, you can use meshcheckrepair() with the 'meshfix' option to repair the bad surface, then tetgen will not complain.
from iso2mesh.
Hi fangq,
Sorry for the delayed response.
I modified my script to include the check and it caused another error.
The script I am using is now:
file_1 = "K:\AMA\ISO2MESH\20mmcube18infillstrokeregioninset2mm.stl"
file_2 = "K:\AMA\ISO2MESH\20mmcube18infillstrokeregioninset3mm.stl"
disp("Importing geometry file data...")
[VL1unchecked,FL1unchecked] = VLFLreadSTLb(file_1)
[VL2unchecked,FL2unchecked] = VLFLreadSTLb(file_2)
[VL1,FL1] = meshcheckrepair(VL1unchecked,FL1unchecked,meshfix)
[VL2,FL2] = meshcheckrepair(VL2unchecked,FL2unchecked,meshfix)
disp(".stl File Reading Complete")
disp("Plotting Individual Files...")
figure
subplot(2,1,1)
plotsurf(VL1,FL1)
subplot(2,1,2)
plotsurf(VL2,FL2)
keepratio=1;
maxvol=10;
addpath('C:\MATLAB\iso2mesh-master\iso2mesh-master')
which vol2mesh
[node,elem,face] = surf2mesh(VL1,FL1,[-100 -100 -100],[100 100 100],keepratio,maxvol);
figure
plotmesh(face(:,1:3),node);
disp("Calculating Boolean Subtraction...")
Which returns the error:
Error in meshfix (line 16)
writeOFF(off_filename,V,F);
Error in PolyComparison (line 27)
[VL1,FL1] = meshcheckrepair(VL1unchecked,FL1unchecked,meshfix)
Previously, I was using:
file_1 = "K:\AMA\ISO2MESH\20mmcube18infillstrokeregioninset2mm.stl"
file_2 = "K:\AMA\ISO2MESH\20mmcube18infillstrokeregioninset3mm.stl"
disp("Importing geometry file data...")
[VL1,FL1] = VLFLreadSTLb(file_1)
[VL2,FL2] = VLFLreadSTLb(file_2)
disp(".stl File Reading Complete")
disp("Plotting Individual Files...")
figure
subplot(2,1,1)
plotsurf(VL1,FL1)
subplot(2,1,2)
plotsurf(VL2,FL2)
keepratio=1;
maxvol=10;
addpath('C:\MATLAB\iso2mesh-master\iso2mesh-master')
which vol2mesh
[node,elem,face] = surf2mesh(VL1,FL1,[-100 -100 -100],[100 100 100],keepratio,maxvol);
figure
plotmesh(face(:,1:3),node);
disp("Calculating Boolean Subtraction...")
Which returned the error:
Error using surf2mesh (line 114)
Tetgen command failed
Error in PolyComparison (line 48)
[node,elem,face] = surf2mesh(VL1,FL1,[-100 -100 -100],[100 100 100],keepratio,maxvol);
I can email you the .stls if that will help.
Your help is much appreciated.
Regards,
Nightbringer
from iso2mesh.
@TheNightbringer117, it appears to me that you called meshcheckrepair() using an incorrect input, please change
[VL1,FL1] = meshcheckrepair(VL1unchecked,FL1unchecked,meshfix)
[VL2,FL2] = meshcheckrepair(VL2unchecked,FL2unchecked,meshfix)
to
[VL1,FL1] = meshcheckrepair(VL1unchecked,FL1unchecked,'meshfix');
[VL2,FL2] = meshcheckrepair(VL2unchecked,FL2unchecked,'meshfix');
and let me know what you see.
from iso2mesh.
I am closing this ticket as there was no updates. feel free to reopen if issue remains.
from iso2mesh.
Dear Fang,
I have used
[node,elem]=meshcheckrepair(nodes_TP(:,2:4),triangularelements,'meshfix').
This generated node array of size103242x3 and element array of size 208868x3.
Later I ran
[node1,face1]=extrudesurf(node(:,1:3),elem(:,1:3),[0 0 +7]);
keepratio = 1;
maxvol=0.1;
[node11,elem11,face11] = s2m(node1,face1,keepratio,maxvol).
still I am getting the same error.
Please help me.
Thanks in advance
from iso2mesh.
extrudesurf can easily generate self-intersecting triangles, you will have to call meshcheckrepair again before calling s2m.
from iso2mesh.
Dear Dr. Fang,
I am using iso2mesh to generate a 4-slab medium, but it generates "Tetgen command failed" error. Could you help with it?
Here is my code:
L = [10, 20, 30];
[node1,face1]=meshabox([0 0 0],[100 100 L(1)], 2sqrt(2), 2^3/6);
[node2,face2]=meshabox([0 0 L(1)],[100 100 L(2)], 2sqrt(2), 2^3/6);
[node3,face3]=meshabox([0 0 L(2)],[100 100 L(3)], 2sqrt(2), 2^3/6);
[node4,face4]=meshabox([0 0 L(3)],[100 100 100], 2sqrt(2), 2^3/6);
[node,face]=mergemesh(node1,face1,node2,face2,node3,face3,node4,face4);
plotmesh(node,face);
[node,elem]=surf2mesh(node,face,[],[],1,2^3/6,[1 1 1; 1 1 11; 1 1 21; 1 1 31],[],0);
Error information:
Error using surf2mesh (line 117)
Tetgen command failed
Error in exmaple_4slab_MMC_simulation (line 13)
[node,elem]=surf2mesh(node,face,[],[],1,2^3/6,[1 1 1; 1 1 11; 1 1 21; 1 1 31],[],0);
Thank you in advance!
from iso2mesh.
@hzhao329, mergemesh
does not do intersection test. it simply concatenate meshes. in your case, separately generated box-shaped meshes are completely overlapping on z=L(1/2/3) and those inconsistent boundaries make it impossible to surf2mesh to create volumetric mesh.
instead of creating boxes for each layer, you should use latticegrid
and this example to create a single mesh of multiple compartment, see
https://github.com/fangq/mmc/blob/master/mmclab/example/demo_sfdi_2layer.m#L20-L41
from iso2mesh.
Related Issues (20)
- Recompile for Apple M1 Macs HOT 1
- smoothsurf works incorrectly HOT 1
- The work of the meshing algorithm is ustable for big meshes HOT 3
- Submodule tools/meshfix points to non existent commit
- Issue when Installing Iso2mesh in cluster (remote computation resources) HOT 1
- Warning about shadowed core library HOT 3
- Merge tetra mesh with multiple elemID within enclosed surface HOT 2
- Iso2mesh ERROR using cgalv2m HOT 5
- cgalv2m does not create flat boundaries HOT 3
- cgalsimp2 command failed HOT 3
- Compiling issue HOT 1
- problem in installing and running iso2mesh in MATLAB HOT 1
- jmeshlib command failed: ERROR- Can't open file. HOT 1
- saveinr() not working for single (float) volumes
- Using qmeshcut to compute an isosurface from an arbitrary grid of points HOT 10
- Binaries for M1/M2 Mac? HOT 3
- Fail to clone submodules. HOT 2
- Compile iso2mesh for ARM Mac HOT 12
- Iso2Mesh Coordinate system origin
- Error using surf2mesh - Error using fscanf Invalid file identifier. Use fopen to generate a valid file identifier.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iso2mesh.