Hello Sean!
So I tried to understand plate-mode implementation for triangle meshes
through BoT primitive as mentioned in the project description page. The
file "bot.c" includes "g_bot_include.c" (Is it a good practice to include a
.c file?), which has all the required functions to raytrace a BoT according
to the precision required (float or double). Now, I observed the following
things after studying it :

Function rt_bot_prep_pieces_ :
Routine to find the bounding RPPs of the pieces of the BoT. It starts with
assigning a thickness value to a variable "los", by performing some sort of
bit test using (BU_BITTEST(bot->bot_facemode, surfno)), which makes it
assign either full thickness on both sides of the plate, or a thickness
centered about the plate (1/2 on both sides). After that an "offset" is
found using this thickness value assigned to "los" in the direction of the
unit normal at each vertex and the face is offset by that amount, to
provide it a thickness (on both sides). Finally, this is assigned to the
"min" and "max" vectors of structure representing the solid (struct soltab).
Return type : void

Function rt_bot_prep_ :
As usual, it checks the validity of the database record being the required
primitive (here, BoT) and then finds the bounding RPPs required for
raytracing if the validity test passes (Uses the rt_bot_pieces_prep_
function). In this case, it also finds the approximate sphere and a
bounding sphere for the BoT.
Return type : int (-1 on failure, 0 on success)

Function rt_bot_plate_segs_ :
Given an array of hits, it provides us the segments of the BoT is the bot
mode is RT_BOT_PLATE / RT_BOT_PLATE_NOCOS. Now, each segment has it's "hit
structure", which tells what is the surface number that the ray has hit and
what is the "in" and "out" distances of the ray for this purticular
segment. So, this hit distance for "in" and "out" points depends on that
bit test we performed in rt_bot_prep_pieces_, ofcourse it's performed here
again.
Return type : int (returns the numberOfHits * 2)

Function rt_bot_unoriented_segs_ :
Same functionality as function above, for an unoriented BoT Solid. Makes
the final number of hits even.
Return type : int (return final numberOfHits)

Funciton rt_bot_makesegs_ :
Make segments of the BoT given the array of hits. This function is called
in rt_bot_shot_ and rt_bot_pieces_shot_. Gives us the segments for the hits
array given. The interesting thing in this function is the FILO algorithm
used for evaluating the "in" and "out" hit points for a ray that grazes a
surface and it's comparison with LIFO. The visual diagram provided is just
awesome for understanding.
Return type : int (return final numberOfHits)

Function rt_bot_shot_ :
Intersects a ray on the BoT and finds the hits. Sorts the hits from near to
far and then finds the segment using rt_bot_makesegs_.
Return type : int (return final numberOfHits)

Function rt_bot_pieces_shot_ :
Intersects a ray with a list of pieces of BoT. Same as above in the
intersecting algorithm.
Return type : int (return final numberOfHits)

I have understood what is plate mode through these functions. If there is
anything that these functions might have missed explaining me, please tell
me where should I learn it from. I would now proceed to understanding NURBS
and how to apply this method to them. I hope to finish understanding things
by tonight so that I can start the proposal tomorrow and submit it for
review.

With Regards,
Kalpit Thakkar

PS : Can you explain to me what does BITTEST do?

PPS : Can you please review my proposal on Object Oriented C++ Geometry
API? I have submitted it on Melange :)


On Tue, Mar 24, 2015 at 12:25 AM, Christopher Sean Morrison <brl...@mac.com>
wrote:

>
> On Mar 23, 2015, at 2:05 PM, Kalpit Thakkar <ceasy...@gmail.com> wrote:
>
> > Hello Sean!
> > I was thinking of proposing another project and I would like to work on
> this project. I checked past 3-4 years' projects, but there hasn't been any
> efforts in this direction.
>
> Indeed.  It’s not a hard project, algorithmically speaking, but nobody has
> yet put forth a quality proposal to work this area.
>
> > So, according to the description there, BoT has a raytracing routine
> that, when finds an "in" point for a ray, due to extremely thin surface,
> assigns the "out" point as the "in" point + the implicit thickness added to
> each coordinate of "in" point and I would have to implement the same
> methodology for NURBS surfaces now.
> >
> > To analyze the problems that I would face in implementing the plate mode
> raytracing for NURBS, I would have to understand exactly how raytracing
> NURBS works. So, is there any specific resource that might help me
> understand this aspect quickly?
>
> Nope.  Understanding how NURBS ray tracing works is not something that can
> be achieved quickly.
>
> But you don’t really need to understand it.  You need to understand what
> plate-mode means — and more specifically you need to understand BRL-CAD’s
> existing plate-mode implementation for triangle meshes.  If you understand
> that, you’ll know exactly what is needed for NURBS plate mode, even without
> understanding NURBS ray tracing.  This requires a lot of reading of code
> and playing with sample geometry.
>
> Cheers!
> Sean
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to