Hide Table of Contents
RayIntersections Method (IModelDoc2)

Intersects a given set of rays with a specified set of bodies.

.NET Syntax

Visual Basic (Declaration) 
Function RayIntersections( _
   ByVal BodiesIn As Object, _
   ByVal BasePointsIn As Object, _
   ByVal VectorsIn As Object, _
   ByVal Options As Integer, _
   ByVal HitRadius As Double, _
   ByVal Offset As Double _
) As Integer
Visual Basic (Usage) 
Dim instance As IModelDoc2
Dim BodiesIn As Object
Dim BasePointsIn As Object
Dim VectorsIn As Object
Dim Options As Integer
Dim HitRadius As Double
Dim Offset As Double
Dim value As Integer
 
value = instance.RayIntersections(BodiesIn, BasePointsIn, VectorsIn, Options, HitRadius, Offset)
C# 
int RayIntersections( 
   object BodiesIn,
   object BasePointsIn,
   object VectorsIn,
   int Options,
   double HitRadius,
   double Offset
)
C++/CLI 
int RayIntersections( 
&   Object^ BodiesIn,
&   Object^ BasePointsIn,
&   Object^ VectorsIn,
&   int Options,
&   double HitRadius,
&   double Offset
) 

Parameters

BodiesIn

Array of bodies that are hit by the rays (see Remarks)

BasePointsIn

Array of doubles containing the x,y,z base points of each ray

VectorsIn

Array of doubles containing the direction vectors of each ray

Options

Number of options as defined in swRayPtsOpts_e

HitRadius

Radius of hit cylinder; this is used mainly in grazing cases to establish a hit

Offset

Length tolerance to use to establish whether a hit on a face represents the entry or exit of the ray from the body (see Remarks)

Return Value

Number of intersections found

Remarks

The method performs the intersection operations between the specified bodies and the ray vectors. To get the results (a set of intersection points, intersection normals, and the bodies that were hit from your bodiesIn array) of the intersection operations, you must call IModelDoc2::GetRayIntersectionsPoints or IModelDoc2::IGetRayIntersectionPoints and IModelDoc2::GetRayIntersectionTopology or IModelDoc2::IGetRayIntersectionsTopology.

Information returned by IModelDoc2::GetRayIntersectionsPoints, IModelDoc2::IGetRayIntersectionPoints, IModelDoc2::GetRayIntersectionTopology, and IModelDoc2::IGetRayIntersectionsTopology depends partially on the value of the options argument. Valid values can be concatenated together using bitwise operations. See IModelDoc2::GetRayIntersectionsPoints or IModelDoc2::IGetRayIntersectionPoints to see which data is always output regardless of the values specified in the options argument.

For each ray that hits an edge or a vertex, the offset distance is added in both the positive and negative directions along the ray and the points computed are tested for spatial inclusion in the hit body. This determines if the ray was entering, leaving, or just grazing the body at the hit point. Entry and exit onto faces can be computed does not require such an offset.

 

See Also

Availability

SolidWorks 2001Plus FCS, Revision Number 10.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   RayIntersections Method (IModelDoc2)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:




x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2012 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.