| Author |
Comment/Response |
Michael
|
07/07/12 12:25pm
In Response To 'Re: Re: Numerical integration over an arbitrary...' --------- Sorry about the link. I've attached a smaller version of the file. (BTW, if you decide you're interested, I figured out a way to speed up the piecewise parametrization of the polygon.)
If your mesher can output the triangles as the coordinates in a regular pattern, such as one point per line, the three coordinates on a line, every three lines denoting a triangle, like this:
1.11 1.12 1.13
1.21 1.22 1.23
1.31 1.32 1.33
2.11 2.12 2.13
2.21 2.22 2.23
2.31 2.32 2.33
[Two triangles, 1.xx and 2.xx]
then
Partition[Import["file", "Data"], 3]
will read the "file" and yield a list of triangles, each a list of points, like this:
{{{1.11, 1.12, 1.13}, {1.21, 1.22, 1.23}, {1.31, 1.32, 1.33}},
{{2.11, 2.12, 2.13}, {2.21, 2.22, 2.23}, {2.31, 2.32, 2.33}}}
There are many other variations, CSV, TSV, etc., that could be made to work, too, depending on the output formats available in your mesher tool.
You might look at the following to figure out if there are better ways to import the output of your mesher tool:
http://reference.wolfram.com/mathematica/guide/3DGeometryAndModelingFormats.html
http://reference.wolfram.com/mathematica/guide/ListingOfAllFormats.html
Attachment: LineIntegral-Polygon.nb, URL: , |
|