Hi,
I’ve got a huge issue with the latest Rhino releases: the result of HiddenLineDrawing.Compute().segments is not computed anymore, or rather the output is missing:
It used to work perfectly with rhino 6 SR9, and it fails with SR14 or later releases. I also tried to force compilation with various rhinocommon versions, but it does not change the issue so Rhino itself has most probably something wrong.
Here is a more detailed sample of code, based on @daleexemple:
Dim HLDParam As New Rhino.Geometry.HiddenLineDrawingParameters
HLDParam.AbsoluteTolerance = doc.ModelAbsoluteTolerance
HLDParam.Flatten = True
HLDParam.IncludeHiddenCurves = True
HLDParam.IncludeTangentEdges = False
HLDParam.IncludeTangentSeams = False
HLDParam.AddClippingPlane(New Plane(Plane.WorldZX) With {.OriginY = Y})
For Each obj In doc.Objects
HLDParam.AddGeometry(obj.Geometry, obj.Attributes)
Next
HLDParam.SetViewport(viewport)
Dim HLD As HiddenLineDrawing = Rhino.Geometry.HiddenLineDrawing.Compute(HLDParam, False)
If HLD Is Nothing Then Exit Sub
For Each HLD_Segment As HiddenLineDrawingSegment In HLD.Segments
Dim attr As ObjectAttributes = TryCast(HLD_Segment.ParentCurve.SourceObject.Tag, ObjectAttributes).duplicate
Dim c As Curve = HLD_Segment.CurveGeometry.DuplicateCurve()
...
Next
@Matthieu_from_NAVINN
I’d like to run your code at my end, can you share more information?
Do you have the Rhino document you are using?
Are you in perspective view?
Is this part of a plugin, or you are running it inside a GH scripting component?
Thanks
Hi @rajaa, it is part of a plugin, with ParallelProjection of Front view. I’ve met the issue with various geometries, including a simple rectangular volume.
I’ve done many tests today and it seems the issue comes from HLDParam.AddClippingPlane(). If I disable this I don’t have these null outputs. Do you know if any changes has been made in Rhino’s recent releases that would impact the clipping planes? Because my code used to work before.
My best guess would be that sometimes objects are computed even when they are on the ‘OFF’ side of the clipping plan, and they end up being Null results.
I can’t send you the plugin since the code is owned by my final user, but I’ll try to do a basic plugin sample.
Thanks @rajaa I’ll give it a try as soon as I have some time. What bothers me is that it used to work before, so there must have been a change somewhere in Rhino that caused the issue somehow.