Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
using JetBrains.Annotations;
using OpenScadGraphEditor.Library;
namespace OpenScadGraphEditor.Nodes
{
[UsedImplicitly]
public class Children : ScadNode, ICanHaveModifier, IImplyChildren
{
public override string NodeTitle => "Children";
public override string NodeDescription => "Renders all children or a subset of all children of a module.";
public override string NodeQuickLookup => "MCld";
public Children()
{
InputPorts
.Array("Selection");
OutputPorts
.Geometry();
}
public override string GetPortDocumentation(PortId portId)
{
switch (portId.Port)
{
case 0 when portId.IsInput:
return "A vector with indices of the children to render. If not given, all children will be rendered.";
case 0 when portId.IsOutput:
return "The geometry of the selected children.";
default:
return "";
}
}
public override string Render(ScadGraph context, int portIndex)
{
var subset = RenderInput(context, 1);
return $"children({subset});";
}
}
}7192f5216This file is pinned to the selected release. Download the original to open it in your design tool.