Message 1 of 2
Export material hatch pattern into raster image
Not applicable
11-20-2017
02:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I would like to export the hatch pattern of a material into an image (*.png, *.jpg...). Since the hatch pattern is vector and the image is raster, is there any API to do that? Here is my code snippet:
Material material = document.GetElement(materialId) as Material;
var fillPatternElement = document.GetElement(material.SurfacePatternId) as FillPatternElement;
if (fillPatternElement != null)
{
FillPattern fillPattern = fillPatternElement.GetFillPattern();
IList<FillGrid> fillGrids = fillPattern.GetFillGrids();
foreach (FillGrid fillGrid in fillGrids)
{
// Do something to generate image texture from hatch pattern
}
}
Thank you.
