HiddenLineDrawing class


Hi @dale

Based on your example - I see that few methods are not available under HiddenLineDrawing class.
I cannot see SetViewport as well as AddObject.
I have checked here: http://developer.rhino3d.com/wip/api/RhinoCommonWin/html/T_Rhino_Geometry_HiddenLineDrawing.htm

Can you please update this example?


V6 Goal: Make2d overhaul
(Dale Fugier) #2

Hi Dmitriy,

The SDK has been refactored a bit. You will need to create a HiddenLineDrawingParameters object, which you will pass to HiddenLineDrawing.Compute. You specify viewport and geometry in this object.

– Dale


Hi @dale
Thanks. I have found out with parameters and can compute segments.
Question is - how to handle a collection of Segments (after computing is done) to get projected 2D curves?



And also it is not clear what should be used as an object argument (obj in the example)

Dim drawp As New HiddenLineDrawingParameters()
drawp.AddGeometry(objpro(i), obj)


(Dale Fugier) #5


(Dale Fugier) #6

If you not sure, just pass a null. This is an arbitrary object that can be used to track the original geometry through the calculation. For example, obj might be a layer index, for example.


Thanks @dale

Another question: how to use CurveSideFills property?
Even though it is described - not sure that I am following this…


(Dale Fugier) #8

Well, you don’t have to use it at all if you don’t want to. But it can be useful for identifying how a curve as created. Some, for example, might use these values to draw the curve with a different linetype or weight depending on their requirements.

– Dale


Hi @dale
I stuck a bit: I need to get projection to the XZ plane.
Below is the code for Viewport:

 Dim vpy As New Rhino.Display.RhinoViewport()
 vpy.Name = "ProY"
 Dim clocY As New Point3D(0, -100, 0)
 vpy.SetCameraLocation(clocY, False)
 vpy.SetCameraDirection(New Vector3d(0, 1, 0), True) 
Dim hld As HiddenLineDrawing = HiddenLineDrawing.Compute(drawp, True)

But the resulting curves are projected to XY plane.
What am I doing wrong?

@actually the projection is done correctly but then resulting objects are placed with XY plane. I am aiming for similar behaviour as with ProjectToPlane.

@ and I cannot see the projection from all the objects. Is it related to the size of the Viewport? do I need to settle it as well? if done through GH make2d component - everything seems to be fine… is it related to tolerance?