POV-Ray : Newsgroups : povray.general : About Raytracing : Re: About Raytracing Server Time
25 Apr 2024 03:39:22 EDT (-0400)
  Re: About Raytracing  
From: scorp08
Date: 12 Jul 2019 04:40:00
Message: <web.5d2846e24548e55256755e030@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "scorp08" <ozo### [at] gmailcom> wrote:
>
> > I am developing a software with python and I want to implement freecad for cad
> > works so is it possible to do same thing with freecad as brlcad did using
> > raytracing??
>
> I guess "yes"?
> https://forum.freecadweb.org/viewtopic.php?t=19219
>
> >
> > Similar to POVray , I want to define a source that emit light (it can be only 1
> > particle or it can be particles which defines an area). Output should contain
> > followings:
> > - Objects name and material IDs of which being hit by the particle or particles
> > from the source
> > -thickness of the objects
> > -location of hitted points in vector form.
> >
> >
> > How can I do that ?
> > Do I need a python script also to get material IDs?
>
> Well with regard to Python, you may be interested in looking at:
> https://zulko.github.io/blog/2014/11/13/things-you-can-do-with-python-and-pov-ray/
>
> You're probably going to want to familiarize yourself with trace () and
> eval_pigment () to get the information you want.
>
> Also, check out this thread:
>
https://news.povray.org/povray.binaries.images/thread/%3C5baddad1%40news.povray.org%3E/
>
> Now, the way I'm thinking about this is:
> you use trace to get the object.  Trace doesn't give you an abject "name", but
> when you use the trace function, you specify the object that you want to shoot a
> ray at.  If you have several objects, and want to shoot a lot of rays, then you
> can use a loop to progress through all of the objects and shoot all of the test
> rays.
> If you choose unique pigment{} statements, then you can determine which pigment
> gets hit by the ray with eval_pigment().
> Do a switcheroo with a real texture, and they are functionally equivalent.
> To get the thickness of the object along the test ray, you can do a trace {},
> get the closest intersection point, and then shoot another ray backwards along
> that vector from twice the bounding box thickness of the object, and that will
> give you the farthest point (assuming there are no complicating factors like
> hollow shells, holes, or other complexities).  Then just subtract the Euclidian
> distance from the camera of the near point from the far point, and you have the
> thickness.
>
> As already stated, trace() will give you the vector coordinates of the
> intersection points.
>
> That should give you a solid start.

Is eval_pigment() used for colors only? because I want to give names to the stl
or step objects then , I will start shooting to get thickness, intersection
points (coordinates) and names of objects
Is it possible ?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.