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
Posted 16 janv. 2011, 14:57 UTC−5 Geometry Version 5.2a 16 Replies
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
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
Please login with a confirmed email address before reporting spam
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
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
Attachments:
Please login with a confirmed email address before reporting spam
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
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Which software did you use to convert the pvd file to stl?
thank
songi
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
was you able to find any solution?
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
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
Attachments:
Please login with a confirmed email address before reporting spam
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!
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.