Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

3D geometry with X,Y,Z file

Please login with a confirmed email address before reporting spam

Hi,

With COMSOLv4.1, how can input automatically differents points in a 3D coordinate, contain in a csv file and create lines between 2 points also automatically.
And after used this curve (sum of all the lines) in order to extrude a 2D geometry along this curve.

Thank you for your answers.

Jean-Martc

16 Replies Last Post 26.07.2016, 14:28 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.01.2011, 15:36 GMT-5
Hi

for me the simples (alltough not obvious if you are not used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming

--
Good luck
Ivar
Hi for me the simples (alltough not obvious if you are not used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.01.2011, 15:52 GMT-5
Hi Ivar,

I don't have matlab interface with comsol.
I think they are possibility via mphtxt file.

Jean-Marc



Hi

for me the simples (alltough not obvious if you are note used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming

--
Good luck
Ivar


Hi Ivar, I don't have matlab interface with comsol. I think they are possibility via mphtxt file. Jean-Marc Hi for me the simples (alltough not obvious if you are note used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming -- Good luck Ivar [/QUOTE]

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 17.01.2011, 00:49 GMT-5
Hi

I have never managed to write directly mpth format, but I agree it should be possible. Another way is perhaps via a DXF or IGES. The thing is that a series of points coordinates needs to be defined/linked with a polyline. because COMSOL eats higher order geometry ;)

--
Bonnes chances
Ivar
Hi I have never managed to write directly mpth format, but I agree it should be possible. Another way is perhaps via a DXF or IGES. The thing is that a series of points coordinates needs to be defined/linked with a polyline. because COMSOL eats higher order geometry ;) -- Bonnes chances Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22.01.2011, 04:15 GMT-5
Hello Ivar,

Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry.
You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z.
s is the curvilinear abscissa between 0 and 1.

And all is ok.
Best regards.

Jean-Marc
Hello Ivar, Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry. You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z. s is the curvilinear abscissa between 0 and 1. And all is ok. Best regards. Jean-Marc


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22.01.2011, 04:37 GMT-5
Hi Jean-Marc

Merci, c'est intéressant.

Indeed, that is the nice thing with COMSOL, they have scientists and engineers, with experience, as rep, and not only salepeople as most other FEM tool vendors do ;)

--
Good luck
Ivar
Hi Jean-Marc Merci, c'est intéressant. Indeed, that is the nice thing with COMSOL, they have scientists and engineers, with experience, as rep, and not only salepeople as most other FEM tool vendors do ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 18.03.2011, 11:35 GMT-4
Hi Jean-Marc

I am having the same issue right here, that I have 7 excel sheets of all x,y and z coordinates, to be imported into COMSOL 4.0 to generate the basic model of a reservoir. I tried to refer to your attached .mph file but I failed to get any outcome. Not sure if 4.1 version doesnt fit into 4.0? do you have a solution in text form to be refered?

Many thanks for your time!!

regards
Liwah, Berlin


Hello Ivar,

Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry.
You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z.
s is the curvilinear abscissa between 0 and 1.

And all is ok.
Best regards.

Jean-Marc


Hi Jean-Marc I am having the same issue right here, that I have 7 excel sheets of all x,y and z coordinates, to be imported into COMSOL 4.0 to generate the basic model of a reservoir. I tried to refer to your attached .mph file but I failed to get any outcome. Not sure if 4.1 version doesnt fit into 4.0? do you have a solution in text form to be refered? Many thanks for your time!! regards Liwah, Berlin [QUOTE] Hello Ivar, Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry. You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z. s is the curvilinear abscissa between 0 and 1. And all is ok. Best regards. Jean-Marc [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.03.2011, 21:17 GMT-4

direct maner to create this type of parametric curve and 3D geometry.
You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z.
s is the curvilinear abscissa between 0 and 1.


*The file attached by Jean-Marc is for Comsol 4.1 and up

I am also interested in how to define geometry from x,y,z coordinates in Comsol 4.

What I have been doing is using the line tool in Comsol 3.5, pasting in the x,y,z coordinates (separated by spaces) and then opening the model in Comsol 4.0a (where the line tool does not allow lists of points).

TT
[QUOTE] direct maner to create this type of parametric curve and 3D geometry. You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z. s is the curvilinear abscissa between 0 and 1. [/QUOTE] *The file attached by Jean-Marc is for Comsol 4.1 and up I am also interested in how to define geometry from x,y,z coordinates in Comsol 4. What I have been doing is using the line tool in Comsol 3.5, pasting in the x,y,z coordinates (separated by spaces) and then opening the model in Comsol 4.0a (where the line tool does not allow lists of points). TT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.04.2011, 07:50 GMT-4
Hey

I finally manage to import everything into COMSOL, but in .stl format, at which I first generate a .pvd file in ParaView, and convert the whole thing into .stl and .vrml files, but in my case, .vrml file does not work fine with COMSOL, so I import .stl instead.

I have all wanted things in COMSOL, but I wonder how well things work themselves out after this :)

regards
Liwah
Hey I finally manage to import everything into COMSOL, but in .stl format, at which I first generate a .pvd file in ParaView, and convert the whole thing into .stl and .vrml files, but in my case, .vrml file does not work fine with COMSOL, so I import .stl instead. I have all wanted things in COMSOL, but I wonder how well things work themselves out after this :) regards Liwah

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.04.2011, 10:08 GMT-4
Hello Wong,
Which software did you use to convert the pvd file to stl?
thank
songi
Hello Wong, Which software did you use to convert the pvd file to stl? thank songi

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.04.2011, 10:15 GMT-4
Hi

Paraview indeed, an open source software :)
one thing that I am still working on is that, not all .stl files are compatible with COMSOL, I have no ideas whats wrong with them at the moment, look, most of my .stl files can be imported into COMSOL to generate a geometry, but sometimes, I received 'STL file is empty' error message.

On the other hand, I also used Paraview to convert .pvd into .vrml (which is also readable by COMSOL), but again, I received 'corrupted VRML file' error message, if I import .vrml instead of .stl.

I appreciate if people out there can help? thanks!

regards
Hi Paraview indeed, an open source software :) one thing that I am still working on is that, not all .stl files are compatible with COMSOL, I have no ideas whats wrong with them at the moment, look, most of my .stl files can be imported into COMSOL to generate a geometry, but sometimes, I received 'STL file is empty' error message. On the other hand, I also used Paraview to convert .pvd into .vrml (which is also readable by COMSOL), but again, I received 'corrupted VRML file' error message, if I import .vrml instead of .stl. I appreciate if people out there can help? thanks! regards

Dulakshi Karunasinghe

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20.09.2011, 06:56 GMT-4
I too have a similar problem. I have some x, y, z coordinates as given below. My problem is to how to convert them to a format, so that they can be imported in COMSOL to define geometry.
thanks in advance!
x1, y1, z1
x2,y2, z2
x3, y3, z3
-
-
-
-






Hey

I finally manage to import everything into COMSOL, but in .stl format, at which I first generate a .pvd file in ParaView, and convert the whole thing into .stl and .vrml files, but in my case, .vrml file does not work fine with COMSOL, so I import .stl instead.

I have all wanted things in COMSOL, but I wonder how well things work themselves out after this :)

regards
Liwah


I too have a similar problem. I have some x, y, z coordinates as given below. My problem is to how to convert them to a format, so that they can be imported in COMSOL to define geometry. thanks in advance! x1, y1, z1 x2,y2, z2 x3, y3, z3 - - - - [QUOTE] Hey I finally manage to import everything into COMSOL, but in .stl format, at which I first generate a .pvd file in ParaView, and convert the whole thing into .stl and .vrml files, but in my case, .vrml file does not work fine with COMSOL, so I import .stl instead. I have all wanted things in COMSOL, but I wonder how well things work themselves out after this :) regards Liwah [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 01.12.2011, 07:30 GMT-5

Hi

for me the simples (alltough not obvious if you are not used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming

--
Good luck
Ivar



Hello,

I can make a 2D shape with matlab by contour plot, but don't know how to use it to create a geometry in comsol4.2a. someone has showed me how to do it in comsol 3.5 with matlab, but it does not work in comsol4.2a with matlab.

Do you have any good idea?Looking forward to your reply.

Thanks very much!

Lu
[QUOTE] Hi for me the simples (alltough not obvious if you are not used to the new matlab interface) is to go via matlab to make a 2D shape and then extrude it. But if your points are fully 3D, you might need a little more thinking and programming -- Good luck Ivar [/QUOTE] Hello, I can make a 2D shape with matlab by contour plot, but don't know how to use it to create a geometry in comsol4.2a. someone has showed me how to do it in comsol 3.5 with matlab, but it does not work in comsol4.2a with matlab. Do you have any good idea?Looking forward to your reply. Thanks very much! Lu

Hasitha Nayanajith Polwaththe Gallage

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 19.11.2013, 01:49 GMT-5
hi,

was you able to find any solution?
hi, was you able to find any solution?

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 25.07.2016, 15:02 GMT-4

Hello Ivar,

Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry.
You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z.
s is the curvilinear abscissa between 0 and 1.

And all is ok.
Best regards.

Jean-Marc


Hi Jean-Marc, I have no idea if you're still kicking around these forums any more but I was hoping that you might be able to upload your .txt file that you used to pull this off. I'm having no such luck. Thanks.

[QUOTE] Hello Ivar, Eric FAVRE from COMSOL France find a direct maner to create this type of parametric curve and 3D geometry. You find enclosed a mph file with the solution. You have to create a file .txt with the differents columns s, x,y,z. s is the curvilinear abscissa between 0 and 1. And all is ok. Best regards. Jean-Marc [/QUOTE] Hi Jean-Marc, I have no idea if you're still kicking around these forums any more but I was hoping that you might be able to upload your .txt file that you used to pull this off. I'm having no such luck. Thanks.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 26.07.2016, 14:26 GMT-4
Hello Nicholas,
In version 5.2a, what Jean-Marc wanted to do (i.e. fit a curve through a bunch of points whose coordinates are contained in a text file) can be done simply by using an Interpolation Curve. To load the coordinates from a text file, choose File for the Data source, then point to the plain text file containing your x,y,z triplets (space-separated).
Best,
Jeff
Hello Nicholas, In version 5.2a, what Jean-Marc wanted to do (i.e. fit a curve through a bunch of points whose coordinates are contained in a text file) can be done simply by using an Interpolation Curve. To load the coordinates from a text file, choose File for the Data source, then point to the plain text file containing your x,y,z triplets (space-separated). Best, Jeff


Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 26.07.2016, 14:28 GMT-4

Hello Nicholas,
In version 5.2a, what Jean-Marc wanted to do (i.e. fit a curve through a bunch of points whose coordinates are contained in a text file) can be done simply by using an Interpolation Curve. To load the coordinates from a text file, choose File for the Data source, then point to the plain text file containing your x,y,z triplets (space-separated).
Best,
Jeff


Awesome, thanks a ton Jeff!
[QUOTE] Hello Nicholas, In version 5.2a, what Jean-Marc wanted to do (i.e. fit a curve through a bunch of points whose coordinates are contained in a text file) can be done simply by using an Interpolation Curve. To load the coordinates from a text file, choose File for the Data source, then point to the plain text file containing your x,y,z triplets (space-separated). Best, Jeff [/QUOTE] Awesome, thanks a ton Jeff!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.