Hi,
I am trying to convert geometry to a drawing via HiddenLineDrawing
.
It works really well, but…
Not always, but sometimes (I know this is not a very good and precise statement) it happens that on top of the curves I create there are the exact same curves put on Layer Default
.
No idea why, any help highly appreciated!
foreach (var item in auxiliaryGeometries)
{
parameters.AddGeometry(item, null);
}
HiddenLineDrawing hld = HiddenLineDrawing.Compute(parameters, true);
foreach (var hld_curve in hld.Segments)
{
if (hld_curve != null)
{
if (hld_curve.CurveGeometry.GetLength() > 0)
{
ObjectAttributes attr = new ObjectAttributes();
attr.ColorSource = ObjectColorSource.ColorFromLayer;
attr.LinetypeSource = ObjectLinetypeSource.LinetypeFromLayer;
if (hld_curve.SegmentVisibility == HiddenLineDrawingSegment.Visibility.Hidden)
{
attr.LayerIndex = hiddenLayer.Index;
}
if (hld_curve.SegmentVisibility == HiddenLineDrawingSegment.Visibility.Visible)
{
attr.LayerIndex = visibleLayer.Index;
}
Curve curve = hld_curve.CurveGeometry.DuplicateCurve();
curve.Transform(forward);
Rhino.RhinoDoc.ActiveDoc.Objects.AddCurve(curve, attr);
}
}
}
Thanks,
T.