Hi
I’m trying to change the direction my offset. In figure A is the result of my code, however, I want the offset to be in the direction of figure B.
I am having difficulty solving this in my code.
Here is my code:
var go = new Rhino.Input.Custom.GetObject();
go.SetCommandPrompt("Select object");
go.EnablePreSelect(true, true);
go.EnablePostSelect(true);
go.GetMultiple(0, 0);
if (go.CommandResult() != Result.Success)
{
return go.CommandResult();
}
var selected_objects = go.Objects().ToList();
foreach (var obj in go.Objects())
{
Point3d point1 = new Point3d(obj.Curve().PointAtStart.X + 0.2, obj.Curve().PointAtStart.Y, obj.Curve().PointAtStart.Z + 0.2);
var curve1 = obj.Curve().Offset(point1, Vector3d.ZAxis, 2, doc.ModelAbsoluteTolerance, CurveOffsetCornerStyle.Sharp);
foreach (var offset_curve in curve1)
{
Guid id = doc.Objects.AddCurve(offset_curve);
doc.Objects.Select(id);
}
}
doc.Views.Redraw();