I am trying to plot a contour plot within a non-rectangular region. I have seen in other posts techniques that involve calculating an interpolation function and using the RegionFunction command within ListContourPlot.
I am using this for a finite element analysis program where the geometry is often complicated (i.e. concave geometry) and it is often difficult to obtain a proper interpolating function.
My idea is to create a plot of the geometry (i.e. structure being analyzed) and fill it all black. Then, I could use that image to mask the stress contour plot, essentially only allowing the contours within the geometry to be exposed.
I have tried this approach with the ImageAdd command; it works, but there are serious drawbacks. It would be much more elegant if the resulting image was a vector so I could re-scale as needed. Also, the ImageAdd command seems to be very slow.
Again, that is my approach and I would be open to suggestions. I have investigated also the idea of plotting the contours in 3D and using clipping to remove the areas I do not want to see, and then aligning the plot to look at it directly above, but this requires some significant effort to assign "pseudo-values" to the points that shouldn't be included in the plot.
I will post an example/desired output soon.