Comments (2)
@tmedani, sorry for the delay.
the reason you got 0 labels in some of the regions was because your seeds were not generated properly.
because in this case, 3 of the surfaces are enclosed by the outer layer, therefore, raysurf.m may not return the seed that is specific for a given region.
raysurf.m works by shooting a ray across a closed surface, finding a pair of intersection points, and use the mid-point as the seed. This only works when a closed surface is not enclosed/enclosing another surface - because the mid-point may be inside the surface being enclosed.
to do this properly, you need to use something like below:
%% define seeds along the electrode axis
[t,baryu,baryv,faceidx]=raytrace(orig,v0,allnode,allface);
t=sort(t(faceidx));
t=(t(1:end-1)+t(2:end))*0.5;
seedlen=length(t);
seeds=repmat(orig(:)',seedlen,1)+repmat(v0(:)',seedlen,1).*repmat(t(:)-1,1,3);
where the allnode/allface
are the combined surfaces of the 3 layers. The raytrace
call returns all intersection points with distance from the ray origin (orig
) stored in t
. So, the mid-point of every segment between adjacent intersection points defines a seed that belongs to a specific region.
Please give above code a try and let me know if you need me to explain this further.
from iso2mesh.
Dear @fangq
Thank you for your answer and no worry for the delay ;)
I tried your solution, it works fine, thanks.
However, since I have three surfaces (in this example), I tried just to use the 3 upper points,
in this case, the label 0 is still here.
So I took the whole 6 points (length(t)) and the outputs are perfect.
I changed the last line to :
seeds=repmat(orig(:)',seedlen,1)+repmat(v0(:)',seedlen,1).*repmat(t(:),1,3);
I removed the (-1)
Thank you again for your help.
Kind regards
Takfarinas
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.