Importing and using 3D CAD for various plots
19 views (last 30 days)
I have 3D simulation data of fluid flow around a 3D geometry. The fluid data is output on a regular XYZ grid and is very easy to import and plot in Matlab, but I have not previously tried to incorporate CAD. Without getting into it, the fluid flow fills the domain even where the solid geometry is meant to be. That means I either need to superimpose the geometry over the flow to hide meaningless flow data in any visualization or have the coordinates of the geometry on the same XYZ grid to remove those points when plotting the fluid flow. I think, for purposes of analysis, that the latter is preferable. The CAD starts as a Solidworks file, is saved as a parasolid, imported into Pointwise, meshed, and exported as Plot3D. The simulation also exports Tecplot (.tp) files of the geometry. I can, of course, save it as many other file types like STL. So far, I've managed to import an STL and superimpose it on a slice plot of the fluid flow. I also want to be able to correctly view it in contour plots and perhaps others, but there doesn't appear to be a straightforward way to slice an imported STL file to show it in a contour. I tried using stlread and then finding the nearest grid point to each point of the STL file. The problem is that the STL geometry has high curvature and so high resolution compared to my fluid flow grid. The result of this method completely obscured the original geometry due to the greatly reduced resolution.
I think what I'm looking for is a way to use the STL imported points to do two things: 1) plot the CAD geometry in multiple ways including 3D and 2D slices that are filled so that they cover the flow data where they share the same space and 2) be able to determine if a grid point for the fluid flow is within the CAD geometry volume or 2D slice to be able to exclude it from plotting or analysis when necessary.