Rhinoceros Jewelry

Plase, jewelry’s diaShape C# sampleCode

Hi Jack,

I doubt anyone is going to understand your question. What is your native language? Can you please try to ask your question again?

Thanks,

– Dale

Hi Junichi,

In the future, if you need help translating Japanese to English, please contact Luna Matsuo.

To create the shape in your image, you need to do the same in C# as you do in Rhino. You first must define a polyline. Then, you need to revolve it.

I’ve attach a sample command for you to review.

Let me know of you have any questions.

– Dale

TestJunichi.cs (1.2 KB)

I build these as a series of lofts from point-circle-circle-circle-point. The code is easier to control the height and girdle thickness etc as relative to origin with the advantage that if you rebuild to degree1 with appropriate number of points you can simulate facetting. Not great but code efficient.

Your command’s RunCommand member should probably look like this:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  Rhino.Geometry.Point3d center = new Rhino.Geometry.Point3d(0, 0, 0);
  const double radius = 10.0;
  Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(center, radius);
  if (doc.Objects.AddCircle(c) != Guid.Empty)
  {
    doc.Views.Redraw();
    return Rhino.Commands.Result.Success;
  }
  return Rhino.Commands.Result.Failure;
}

A post was split to a new topic: Create Brep from Curves