RhinoCommon: Sorting of curves in HiddenLineDrawing


Hello @GregArden

I am experimenting further with HiddenLineDrawing Class.
Please see file enclosed.

Make2D_CurveSorting.3dm (114.0 KB)

Blue curve belongs to the surface. HiddenLineDrawing sometimes computes this curve as Hidden and sometimes - not.
Is it possible to set that such curves need to be always considered as Hidden?

Thanks a lot in advance,


And even more complicated question: how to differentiate between red and blue curve in case if both are computed as Hidden?

Make2D_CurveSorting_2.3dm (118.2 KB)



Hello @GregArden,

One more issue related to this:
Sidefill value given below has only 3 values:

  • SideUnset or 0
  • SideSurface or 1
  • SideVoid or 2


However some segments are also giving results with index 3. What Index 3 stays for?



Hello again @GregArden maybe this time aslo @dale

I am trying to get a SourceObject.Geometry for Parent Curve from Segment after computing HLD.
I also checked: Segment.ParentCurve.SourceObject.Geometry.IsValid
However at some point Rhino just crashes.
If I use SourceObjectComponentIndex.ComponentIndexType - everything works fine. Very strange…

Any hint what is going wrong?


(Rajaa Issa) #8

Hi @Dmitriy
Sorry it took a while to get back to you. You have few questions here. Let me see if I can address some of them.
It seems to me that in both examples, curves from the inner surfaces are expected to produce visible lines (since they intersect with the walls). I’d like to test the case when they are marked as hidden instead of visible. Do you have an example, or does that happen randomly?
It is curious that you see a SideFill value=3. Can you share an example that I can debug at my end with such value? Same with the “Segment.ParentCurve.SourceObject.Geometry.IsValid”, it would help great deal to debug an example.


Hello @rajaa

Thanks for taking this further.

Well, I am experimenting with rather simple examples - so please find file enclosed.
Make2D_CurveSorting_ToMcNeel.3dm (198.8 KB)

Layers are arranged to accommodate each type of the Segment.SegmentVisibility.
If segment is Visible - then sub-layers are arranged to receive different combinations of FillSide(0) and FillSide(1).

From there you can easily trace what combination of FillSide is produced.
Geometry to include into HLD is given in layer Geo.
Curves are produced in top view and translated with -50 units in y direction.

Current HLD is computed with tolerance 0.001. However, when decreasing tolerances - output is different.

Now to the SourceObject -> when I try to receive any info about SourceObject (one of the Breps located on Layer “Geo”) - my Rhino is hard-crashed, see below:


All computing I am doing in custom GH component - therefore I cannot post complete code here.

P.S. Is @GregArden is still a main developer behind HLD or you took it over?

Thanks a lot in advance,


(Rajaa Issa) #10

@Dmitriy can you share the code you have written to extract vector drawing? You may email directly to me if you’d rather keep it confidential.

Greg is the developer that writes the HLD SDK and the core calculation code. I wrote the Make2D command that uses the SDK classes and output result. Some reported bugs are command level (I’m the one that fixes those), but others have to do with how curves are calculated, and what properties they have, and Greg takes care of those. I hope this helps.

(Greg Arden) #11

Regarding your file [Make2D_CurveSorting.3dm ] where an edge of one surface is lying on the interior of another visible surface. It looks to my like a curve that lies on a visible portion of a surface is visible, even if the surface that is boarders is occluded. Do you think this is wrong? What kind of realistic model do you have that is presenting a problem? I don’t have a way of identifying this case in the HLD output currently.

(Greg Arden) #12

Value 3 for SideFill is OtherSurface.
This indicates that the region to this side of the curve is filled by another surface that is not connected in the 3d model to this edge. For example in the model and hiddenline drawing shown Object_Silhouette.3dm (332.6 KB) the pink lines have SideFill of { SideSurface, OtherSurface} indicating they are kind of an object silhouette, ( actually a discontinuity of the camera ray intersection , as you move across this line the camera ray is intersecting a different object or the same object but at a different depth).

Please let me know if this is useful or if you find bugs.

This feature of HiddenLineDrawing may have bugs because it is not used in the Make2d command.

The first bug is the documentation of the class ON_SIL_EVENT::SIDE_FILL in the C++ SDK and HiddenLineDrawingSegnment in RhinoCommon.

(Greg Arden) #13

If you can post a model and a GH component that demonstrates the crash that would be very helpful.

Also in your model you have surfaces that intersect where the intersection is not part of the model. This will now work well in Make2d/HiddenLineDrawing. Still it shouldn’t crash.


Hello @GregArden

While I am checking SideFill condition, I have sent you a message.



Hello @GregArden

I don’t think it is wrong neither right. This depends on the application purpose. It just would be nice to identify those curves as separate type.
At the moment I have found out those curves can be computed as Hidden and Visible. When visible - they are of SideFill type SideSurface(1)+OtherSurface(3) or OtherSurface(3)+SideSurface(1). That is already good as it narrows down any additional check that would be required.

I have an idea how to do this, but to check it - I need to be able to access SourceObject at first and this is a point where I experience crash.


Considering what you wrote in the previous post - I have analysed curves produced with HLD in my file (enclosed here earlier Make2D_CurveSorting_ToMcNeel.3dm). All the curves computed as visible are having SideFill 3(OtherSurf)-1(SideSurf) which is correct. But at the same time such curves sometimes are computed as Hidden.

(Brian Gillespie) #17

RH-45865 is fixed in the latest Service Release Candidate