Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ray intersection information extraction

Status
Not open for further replies.

nikhiljoglekar

Mechanical
Apr 8, 2003
17
hi
I am trying to fire ray and find out the intersection wit the parts. However I want to know if the ray is entering or exiting. The help document says that the intersection type that is returned is "OR'd". I am not sure what this means. How can I extract the information from the results? The help description is as follows

"(long) intersectionType type of intersection found. Refer to swRayPtsResults_e . Entry/Exit information (swRayPtsResultsENTER and swRayPtsResultsEXIT) will only be returned when swRayPtsOptsENTRY_EXIT is specified in the options argument in the ModelDoc2::RayIntersections call) If more than one intersection type is found, then the intersectionType will contain an OR'd set of values from the swRayPtsResults_e enumeration.
"

 
Replies continue below

Recommended for you

Hey there... basically what that is saying is that unless you specify that you are seeking entry or exit points that it will store the information for all bodies/entities hit by the ray as as it penetrates the model and will arrange in a safearray. If you look at the swRayPtsOpts_e entry in the api help it shows that it will be concatenated using boolean 'or" operations.. and stored like this:

swRayPtsOptsNORMALS - Output of normals requested

swRayPtsOptsTOPOLS - Output of entities hit requested

swRayPtsOptsENTRY_EXIT - Output requested of whether ray was entering or exiting body when it hit

swRayPtsOptsUNBLOCK - Allow the system to respond while waiting

i dont have much experience with this command but i hope this helps a little...



Regards,
Jon
jgbena@yahoo.com
 
hi jon
thanks for your reply. I know I have to concatenate. My question was regarding how to decipher the entry exit points from the reult. I get some result definately. It says it will be "OR'd" I don't know the meaning of this term.
anyways thanks for the reply. If anybody knows how to decipher the result please let me know
thanks
nikhil
 
a little background boolean .....

basically, a whole bunch of information is being returned in the long integer. In an Int or long, you can express the number as bits(boolean) where bit 0=1, bit1=2, bit 2=4, bit 3=8, etc, etc.

example: 00000001 binary = 1 decimal
00000011 binary = 3 decimal (bit 0 AND bit 1 are true) (bit 0 OR bit 1 are true)

so, by having each of many values equal to a power of 2, you can get many true/false values from one return number.


 
hi rocheey
thanks for the tip. However the problem is how to reverse the process. How should I get the booleans out of a long when long is a result of the OR operation on few booleans.
any tips will be helpful
thanks
nikhil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor