DragRay

References
public sealed class DragRay
A ray in a viewport used for picking and dragging shapes in 3D.

Constructors

DragRay

#
public DragRay(RhinoViewport viewport, Line ray, DragPickingMode pickMode)
viewport (RhinoViewport)
ray (Line)
pickMode (DragPickingMode)

Properties

CPlane

#
public Plane CPlane { get; }
Gets the construction plane of the viewport at the time of pick.

CurveRadius

#
public double CurveRadius { get; set; }
Gets an acceptable distance (measured in pixels) from a ray to an edge to count as a hit.

MaximumParameter

#
public double MaximumParameter { get; }
Gets the furthest parameter along the ray where a hit may still be considered.

PickMode

#
public DragPickingMode PickMode { get; }
Gets whether the ray is designed to hit sub-objects or only whole objects.

PointRadius

#
public double PointRadius { get; set; }
Gets an acceptable distance (measured in pixels) from a ray to a point to count as a hit.

Projection

#
public Transform Projection { get; }
Gets the projection from world space into viewport space. This projection eradicates the z-depth, so it can be used directly to measure separation between shapes in the XY plane.

Ray

#
public Line Ray { get; }
Gets the ray. Note that the start point of the ray is meaningful. The line ought not hit any objects behind the start point.

Methods

CreateHitAt

#
public DragHit CreateHitAt(IDragAware obj, Point3d pointOnShape, Site site, PointKind scale)
Create a new hit result along this ray.
obj (IDragAware)
pointOnShape (Point3d)
site (Site)
scale (PointKind)

PixelDistance

#
public double PixelDistance(Point3d a, Point3d b)
Measure the visual separation (in pixels) between two points in the viewport.
a (Point3d)First point.
b (Point3d)Second point.
Pixel distance between the points given the viewport projection.