×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ray intersection information extraction

ray intersection information extraction

ray intersection information extraction

(OP)
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.
"

RE: ray intersection information extraction

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

RE: ray intersection information extraction

(OP)
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

RE: ray intersection information extraction

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.                            


RE: ray intersection information extraction

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources