asymmetric shape

76 views
Skip to first unread message

mari sadat

unread,
Feb 9, 2023, 9:32:26 AM2/9/23
to iso2mesh-users
Hello Dr.Fang
I want to mesh a 4 layer cube with asymmetric 3D shape in it. This three-dimensional shape can have a star-like cross-section in the first layer of the cube, which decreases its radius as the thickness increases in the lower layers of the cube.
I did it with cylinder successfully and got my results but for this asymmetric shape I do not find appropriate function.
Would you guide me if you have any ideas, please?

Qianqian Fang

unread,
Feb 9, 2023, 5:41:42 PM2/9/23
to iso2mes...@googlegroups.com, mari sadat
it is not entirely clear to me what shape you are trying to mesh. do you have a drawing or plot to show what you want to achieve? and which step were you having trouble?
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/b0cb8b3f-2c35-42b2-afdc-6d852975ec93n%40googlegroups.com.


mari sadat

unread,
Feb 10, 2023, 11:34:35 AM2/10/23
to iso2mesh-users
Dear Dr. Fang
Thanks for your kind attention.
The geometric model of my previous work was a four-layer cube and a cylinder inside it, which is shown in picture 1.
Now I plan to place an asymmetric shape instead of a cylinder, which has an asymmetric cross section instead of a circular section, and its section radius decreases in the direction of the z axis, like something similar to figure 2 in the attachment.
My problem is designing this shape to be compatible with ISO2mesh toolbox.
1.png
2.png

Qianqian Fang

unread,
Feb 10, 2023, 10:03:33 PM2/10/23
to iso2mes...@googlegroups.com, mari sadat

you can call surfboolean(.., 'resolve', ...) to intersect two arbitrarily complex surfaces - each may contain multiple closed compartments (such as latticegrid), and then call s2m(..., 'tetgen1.5', ...) to mesh the output and uniquely label each enclosed region.

please see the below script as an example. the output screenshots are attached.

% create shape 1
n1=[50,50,-10; 80,20,100; 30,20, 100; 50, 70, 100];
e1=[1,2,3,4]

% create multi-layer structure and extract the surface
[node,face,c0]=latticegrid([0 100],[0 100],[0 30 50 80]);
[n2,e2,f2]=surf2mesh(node,face,[],[],1,10,c0);
[n3,f3]=removeisolatednode(n2,f2(:,1:3));
f1=volface(e1);

% resolve the two surfaces
[nn, ff]=surfboolean(n1,f1,'resolve',n3,f3);
% volumetric meshing
[node, elem]=s2m(nn, ff, 1, 10, 'tetgen1.5');
% alternatively, you can manually seed each region using the below call
% [node, elem]=s2m(nn, ff, 1, 100, 'tetgen', [c0; [c0(:,1)-30, c0(:,2:3)]]);

figure;
plotmesh(nn,ff, 'y>20')
figure;
plotmesh(node, elem, 'y>50')


in addition, you can do this fairly easily using a combination of Blender and our recently released BlenderPhotonics addon (https://github.com/NeuroJSON/BlenderPhotonics). BlenderPhotonics is basically a front-end for Iso2mesh and MC photon simulator. See our paper for details

https://doi.org/10.1117/1.JBO.27.8.083014

hope this helps

Qianqian


On 2/10/23 11:34, mari sadat wrote:
Dear Dr. Fang
Thanks for your kind attention.
The geometric model of my previous work was a four-layer cube and a cylinder inside it, which is shown in picture 1.
Now I plan to place an asymmetric shape instead of a cylinder, which has an asymmetric cross section instead of a circular section, and its section radius decreases in the direction of the z axis, like something similar to figure 2 in the attachment.
My problem is designing this shape to be compatible with ISO2mesh toolbox.




On Friday, February 10, 2023 at 2:11:42 AM UTC+3:30 q.fang wrote:
it is not entirely clear to me what shape you are trying to mesh. do you have a drawing or plot to show what you want to achieve? and which step were you having trouble?

On 2/9/23 09:32, mari sadat wrote:
Hello Dr.Fang
I want to mesh a 4 layer cube with asymmetric 3D shape in it. This three-dimensional shape can have a star-like cross-section in the first layer of the cube, which decreases its radius as the thickness increases in the lower layers of the cube.
I did it with cylinder successfully and got my results but for this asymmetric shape I do not find appropriate function.
Would you guide me if you have any ideas, please?
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/b0cb8b3f-2c35-42b2-afdc-6d852975ec93n%40googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
lattice_intersect_shape.png

mari sadat

unread,
Feb 11, 2023, 5:14:43 PM2/11/23
to Qianqian Fang, iso2mes...@googlegroups.com
Dear professor

Thanks for your valuable advice.
I got an idea from your script. I think by applying some changes in it, I can get close to my desired geometrical model.
In addition, I am surprised to know about your new software and thank you very much for introducing such a nice one to me.

With the best wishes
Sincerely yours
Mari

mari sadat

unread,
Jul 20, 2023, 5:49:44 AM7/20/23
to iso2mesh-users



mari sadat maris...@gmail.com

Jun 21, 2023, 3:50 PM




to Qianqian
Hello  professor
excuse me for too many questions..

I tried this code:

n1=[1,1,0; 1.2,1.1,.81; 1.6,.5,.81; .5, 1.2, .81];
e1=[1,2,3,4];
f1=volface(e1);
figure;
plotmesh(n1,f1)

[node,face,c0]=latticegrid([0 2],[0 2],[0 0.5 0.7 0.79 0.82]);

[n2,e2,f2]=surf2mesh(node,face,[],[],1,10,c0);
[n3,f3]=removeisolatednode(n2,f2(:,1:3));

% resolve the two surfaces
[nn, ff]=surfboolean(n1,f1,'resolve',n3,f3);
% volumetric meshing
[node, elem]=s2m(nn, ff, 1, 10, 'tetgen1.5');

figure;
plotmesh(nn,ff)
figure;
plotmesh(node, elem)

but this error appeared:

PLC Error:  A vertex and a facet intersect at (0.709819,0.873558,0)
  Vertex:  #5155
  Facet:   [65,5050,5115] #0
A self-intersection was detected. Program stopped.
Hint: use -d option to detect all self-intersections.

How can i detect self intersections?
What is -d option?

mari sadat

unread,
Jul 20, 2023, 6:07:00 AM7/20/23
to iso2mesh-users
How can I add other facets to it?
For example, the cross section of the desired shape be a rhombus or a pentagon.

Thanks for your kind attention

Qianqian Fang

unread,
Jul 20, 2023, 9:34:34 PM7/20/23
to iso2mes...@googlegroups.com, mari sadat

if you change the z-coordinate of the lowest node in your n1 list to a small positive number instead of 0, for example

n1=[1,1,1e-4; 1.2,1.1,.81; 1.6,.5,.81; .5, 1.2, .81];

your code will run.


the previous issue is that your n1(1,:) node is exactly co-planar to your lattice grid's bottom face. Processing co-planar geometries is an extremely difficult problem that there is almost no existing tool/library can handle it robustly, including the cork utility called by surfboolean in iso2mesh.


because of this, you should never create co-planar shapes before boolean/merge.

Reply all
Reply to author
Forward
0 new messages