Hi all,
I am working on a Grasshopper toolpath visualizer that relies on DisplayConduit on Windows. It keeps a list of extrusion meshes and draws them during the preview:
namespace Toolpaths.Fdm.Visualizers
{
public class AdditiveDisplayConduit : DisplayConduit
{
public List<Mesh> ChunksToDraw { get; set; } = new List<Mesh>();
public List<Mesh> ActiveMeshesToDraw { get; set; } = new List<Mesh>();
public Mesh ToolMesh { get; set; }
public Point3d ToolPosition { get; set; }
private readonly DisplayMaterial _material;
public AdditiveDisplayConduit()
{
_material = new DisplayMaterial(Color.CornflowerBlue);
}
public void DrawMeshes(IGH_PreviewArgs args)
{
foreach (var mesh in ChunksToDraw)
{
if (mesh != null && mesh.IsValid)
args.Display.DrawMeshShaded(mesh, _material);
}
foreach (var mesh in ActiveMeshesToDraw)
{
if (mesh != null && mesh.IsValid)
args.Display.DrawMeshShaded(mesh, _material);
}
if (ToolMesh != null && ToolMesh.IsValid)
{
args.Display.DrawMeshShaded(ToolMesh, _material);
}
}
public void DrawWires(IGH_PreviewArgs args) { }
}
}
This works great on Windows Rhino 8, but I’m now trying to use something similar for Mac. From what I can tell DisplayConduit doesn’t exists there, at least that’s what the docs say.
Is there a recommended cross-platform replacement for conduit-style previews on Mac? Should I tap into the viewport draw events differently, or move the logic into the Grasshopper preview pipeline somehow? Any examples or docs that show how to render large meshes on rhino for mac would be appreciated.
Thanks!
