Editor component that implements IArchFiler for roof gutter channels. It creates an ArchMesh canvas, iterates drawn ArchRunPath runs, generates gutter geometry via ArchGutterGen.Run using the filing kit and style brush, and adds the resulting mesh to filing output under a gutters/channel path.
using System.Collections.Generic;
using Sandbox;
namespace Sunless.Architecture;
// The channel is one mesh gathered from every run the roof shed into, so it is filed beside the roof's own pieces
// rather than drawn as a layer of its own.
public sealed class ArchGutterChannelFiler : IArchFiler
{
public string Files => ArchFiles.GutterChannel;
public void File( ArchFiling filing )
{
var building = filing.Within<ArchBuilding>();
var canvas = new ArchMesh( filing.Within<Transform>() );
foreach ( var run in filing.Drawn<List<ArchRunPath>>() )
{
ArchGutterGen.Run( canvas, run, filing.Kit, filing.Style.Brush( ArchSurface.Gutter, building.Palette ) );
}
filing.Output.Add( $"{filing.Path}/{ArchPieces.Gutters}/{ArchPieces.Channel}", Transform.Zero, canvas );
}
}