Skip to content

Instantly share code, notes, and snippets.

@sbaer
Created September 9, 2013 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbaer/6502974 to your computer and use it in GitHub Desktop.
Save sbaer/6502974 to your computer and use it in GitHub Desktop.
Debugging a Custom Mesh Problem
using System;
using Rhino;
using Rhino.Commands;
using Rhino.Geometry;
namespace examples_cs
{
[System.Runtime.InteropServices.Guid("476cc15c-8979-4325-8819-298024efbb56")]
public class CustomMeshCommand : Command
{
public override string EnglishName
{
get { return "CustomMeshCommand_CS"; }
}
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var base_mesh = Mesh.CreateFromSphere(new Sphere(Point3d.Origin, 10.0), 20, 20);
TestCustomMesh mesh = new TestCustomMesh(base_mesh);
doc.Objects.AddRhinoObject(mesh);
doc.Views.Redraw();
return Result.Success;
}
}
public class TestCustomMesh : Rhino.DocObjects.Custom.CustomMeshObject
{
public TestCustomMesh()
{
}
public TestCustomMesh(Mesh mesh)
: base(mesh)
{
}
public override string ShortDescription(bool plural)
{
if (plural)
return "TestCustomMeshes";
return "TestCustomMesh";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment