Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
On Fri, Mar 18, 2016 at 6:47 PM Param Hanji 
wrote:

>
> I'll start looking into the code as soon as i can. Is there any resource I
> can refer to get a brief high level understanding of how ray tracing
> occurs. I have no knowledge of computer graphics and even theoretical
> resources pertaining to the specific functions(eval, weave) would be
> helpful. I'll look out for some on my own too.
>

Ignore the bit about ray tracing. I just want to know about the specific
functions.

Thanks!
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
Yeah sending the output to the file fixed it. I'll add in my implementation
for epa and submit a patch soon.

 Also, I was wondering if my GSOC proposal could include accelerating some
more primitives(perhaps even all). This will buy me time to get use to the
BRL-CAD codebase and also enable me to learn up about CSG and how the
boolean evaluation is implemented. Parallelizing bool.c could happen later.

Just a thought. Thank you again.

Best,
Param

On Thu, Mar 17, 2016 at 3:04 AM Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Wed, Mar 16, 2016 at 9:32 PM, Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Wed, Mar 16, 2016 at 9:12 PM, Param Hanji 
>> wrote:
>>
>>> Yes, there was an error message on the terminal. Manually copying
>>> everything to my current directory worked. Compilation starts but throws a
>>> "pixel fb_write error". I think this is from rt/do.c from clt_run().
>>>
>> That's weird. If you are outputting to a file it shouldn't try to use the
>> frame buffer. The frame buffer is used to render to the screen inside the
>> MGED interface. Did you use something like:
>>
>> make tgc tgc
>> e tgc ; rt -z 1 -o rt_tgc.pix
>>
>> I think Sean said you could use .png instead of .pix as well.
>>
>> Or did you use the MGED interface instead of choosing an output file? Try
>> both approaches.
>>
>> I'm really unfamiliar with this bit of code. Any idea how to fix this?
>>>
>>
>> I can't reproduce your issue here. Try the workarounds I suggested.
>> fb_write is a wrapper around a bunch of possible backends so its possible
>> you are hiting some poorly tested code path. I would need at least a GDB
>> stack trace to start looking into it.
>>
>
> i.e. it sounds like it rendered the image with OpenCL fine the problem is
> with the output.
>
> --
> Vasco Alexandre da Silva Costa
> PhD in Computer Engineering (Computer Graphics)
> Instituto Superior Técnico/University of Lisbon, Portugal
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


[brlcad-devel] Current progress with mesh healing reagrding BoTs

2016-03-19 Thread Rakshika Bagavathy
Hello all,


Current features in BoT, with possible modifications:

1. A struct bot_edge exists with attributes as the destination vertex,
use_count - no. of faces using it (0/1/2), next edge.

*Suggestion*: To add the faces using it. This will aid the face adjacencies
to be set more easily. If at any time we require the adjacent faces of any
particular triangle, without the face information in the bot_edge structure
we will have to search the entire face list. If we do include that
information, we can get the adjacent faces through that. Basically a shift
from O(n) to O(1).

2. Edges with use_count = 0 (dangling edges) are removed.



3. > Unused vertices and duplicate vertices are removed.

   In the function rt_bot_condense in bot.c, for vertex merging, bin
sorting has been used as the better alternative. But if all the points have
the same x-coordinate (points are put into different bins based on the
x-coordinate), then that would be the worst case when it would take O(n^2)
time.



   *Suggestion*: Instead if we use a balanced binary search tree (AVL
tree), for a point if we need to search if there is an equivalent vertex,
that would only take O(log n) time. So, overall this would be over in
O(n*logn) time, even in the worst case. This can be implemented.



  > Two equivalent faces are fused.



Essentially, removal of isolated, duplicate vertices, and dangling edges,
operations to produce more efficient usage of edges, and a few mesh
optimization operations are already implemented in BoT.

The geometric errors that need attention now are: gaps, overlaps, T-joints,
self-intersection, degenerate faces, sliver patches/skewed elements. And
they will be handled according to their orientation, mode, and the
circumstances in which the error is present.



Reference: Generating topological information from a bucket of facets (Rock
and Wozny, 1992)

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.492.4919=rep1=pdf
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] GSoC 2016 (Introduction)

2016-03-19 Thread Amritpal Singh
On Mon, Mar 14, 2016 at 11:08 PM, Charlie Stirk  wrote:
> No, you need to look at how IfcOpenShell does the IFC implicit geometry with
> OpenCasCade.

Ok.

>> Now what we can do for starting this project?
>
>
> You need to understand what you need to do before you start doing.   Do more
> research.   Take a look at the similarities and differences of IFC and STEP
> files.   Take a look at how IfcOpenShell works.   See how BRL-CAD modeling
> primitives could do the implicit geometry in IFC.   Then come back when you
> understand this and have questions.   Work on a patch for BRL-CAD, like a
> simple change to the step-g importer that checks for the .ifc file
> extension, and removes the IFC prefix from all the entities.

https://github.com/amrit3701/ifc2stp

In the above program, I made a bash script which runs with c++ code.
Bash script just removes all the ifc prefix from all entities present
in IFC file and saves it with new extension i.e. stp.

Now we will take care for handling all the implicit IFC geometry
(procedural things like extrusions) with BRL-CAD.

-- 
Amritpal Singh
Guru Nanak Dev Engineering College, India
http://www.amritpals.com/
https://github.com/amrit3701

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
Hi,

My parallel epa still shows up a black screen. Is there anything wrong with
my code? I looked hard for errors but couldn't find anything.I'll send you
my patch.

Thanks!


On Fri, Mar 18, 2016 at 3:06 AM Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Thu, Mar 17, 2016 at 7:54 PM, Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Thu, Mar 17, 2016 at 7:47 PM, Christopher Sean Morrison <
>> brl...@mac.com> wrote:
>>
>>>
>>>
>>> On Mar 17, 2016, at 05:33 AM, Param Hanji 
>>> wrote:
>>>
>>> Great. I'm happy to help!
>>> Also is ehy running fine in OpenCL mode? My generated PNG is just a
>>> blank black screen with no figure. The terminal logs don't seem to indicate
>>> anything wrong. Maybe ehy_shot.cl has a bug?
>>>
>>>
>>> 1) Does that exact same ehy render correctly in non-OpenCL mode?
>>> 2) Does another primitive (e.g., an ell via mged> make ell ell) render
>>> correctly in OpenCL mode
>>>
>>
>> The problem is the material lighting code. The results are not the same.
>> In OpenCL mode it renders that ehy in a really dark color and you nearly
>> miss it. If you render the ehy in surface normals lighting mode (i.e. rt
>> -z1 -l2) the output is as expected here.
>>
>
> The problem was more complicated that I thought. It turns out the OpenCL
> code was calling the ehy normal computation routine more than once. It
> turns out that routine (ehy_norm) both depends on hit_vpriv to compute the
> proper normal, and clobbers hit_vpriv after normal computation to store
> some temporary value for later computation of curvatures.
> It just so happens that this only happened in the Full lighting mode.
>
> I put a fix for this on SVN trunk.
>
> --
> Vasco Alexandre da Silva Costa
> PhD in Computer Engineering (Computer Graphics)
> Instituto Superior Técnico/University of Lisbon, Portugal
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
--- src/librt/librt_private.h	2016-03-15 13:28:31.225331492 +0530
+++ src/librt/librt_private.h	2016-03-15 14:14:31.773364136 +0530
@@ -194,7 +194,6 @@
 CLT_DECLARE_INTERFACE(sph);
 CLT_DECLARE_INTERFACE(ehy);
 CLT_DECLARE_INTERFACE(bot);
+CLT_DECLARE_INTERFACE(epa);
 
 extern size_t clt_bot_pack(struct bu_pool *pool, struct soltab *stp);
 #endif
--- src/librt/primitives/epa/epa.c	2016-03-07 09:20:47.247217894 +0530
+++ src/librt/primitives/epa/epa.c	2016-03-13 15:55:46.0 +0530
@@ -184,36 +184,6 @@
 { {'\0', '\0', '\0', '\0'}, 0, (char *)NULL, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
 };

+
+#ifdef USE_OPENCL
+/* largest data members first */
+struct clt_epa_specific {
+	cl_double epa_V[3]; /* vector to epa origin */
+	cl_double epa_Hunit[3]; /* unit H vector */
+	cl_double epa_SoR[16];  /* Scale(Rot(vect)) */
+	cl_double epa_invRoS[16];   /* invRot(Scale(vect)) */
+};
+
+size_t
+clt_epa_pack(struct bu_pool *pool, struct soltab *stp)
+{
+	struct epa_specific *epa =
+		(struct epa_specific *)stp->st_specific;
+	struct clt_epa_specific *args;
+
+	const size_t size = sizeof(*args);
+	args = (struct clt_epa_specific*)bu_pool_alloc(pool, 1, size);
+
+	VMOVE(args->epa_V, epa->epa_V);
+	VMOVE(args->epa_Hunit, epa->epa_Hunit);
+	MAT_COPY(args->epa_SoR, epa->epa_SoR);
+	MAT_COPY(args->epa_invRoS, epa->epa_invRoS);
+	return size;
+}
+
+#endif /* USE_OPENCL */
+
+
 /**
  * Create a bounding RPP for an epa
  */
--- src/librt/primitives/epa/epa_shot.cl	1970-01-01 05:30:00.0 +0530
+++ src/librt/primitives/epa/epa_shot.cl	2016-03-07 15:50:24.033081000 +0530
@@ -0,0 +1,139 @@
+#include "common.cl"
+
+
+/* hit_surfno is set to one of these */
+#define EPA_NORM_BODY	(1)		/* compute normal */
+#define EPA_NORM_TOP	(2)		/* copy epa_N */
+
+
+struct epa_specific {
+	double epa_V[3];		// vector to epa origin
+	double epa_Hunit[3];	// unit H vector
+	double epa_SoR[16];		// Scale(Rot(vect))
+	double epa_invRoS[16];	// invRot(Scale(vect))
+};
+
+int epa_shot(RESULT_TYPE *res, const double3 r_pt, const double3 r_dir, const uint idx, global const struct epa_specific *epa)
+{
+	double3 dp;			// D'
+	double3 pp;			// P'
+	double k1, k2;		// distance constants of solution
+	double3 xlated;		// translated vector
+	struct hit hits[3];	// 2 potential hit points
+	struct hit *hitp;	// pointer to hit point
+
+	hitp = [0];
+
+	dp = MAT4X3VEC(epa->epa_SoR, r_dir);
+	xlated = r_pt - vload3(0, epa->epa_V);
+	pp = MAT4X3VEC(epa->epa_SoR, xlated);
+
+	// Find roots of the equation
+	double a, b, c;		//coeffs of polynomial
+	double disc;		// disc of radical
+
+	a = dp.x * dp.x + dp.y * dp.y;
+	b = 2 

Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Christopher Sean Morrison
 --
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Qt Display Manager

2016-03-19 Thread Jasvir Singh
On Fri, Mar 11, 2016 at 11:06 AM, Clifford Yapp  wrote:
> http://screencloud.net/v/ori3
>>
>> Can anyone please help me to figure it out?
>
> That looks like it's just the placeholder OpenGL Qt widget not getting
> updated - remember, there's no drawing activity going on so the canvas
> area is not refreshing itself.
>
> CY

Hey Clifford,
Can you please tell me the purpose of src/libdm/dm-qt* .
By reading the function I can figure out that it is for drawing
purpose but where is it supposed to be used?

-- 
Jasvir Singh Grewal

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
Oops I did manually edit the patch. I ran diff again and uploaded the patch
without changes. I also changed the ID used to 19.

On Sat 19 Mar, 2016, 2:51 AM Vasco Alexandre da Silva Costa, <
vasco.co...@gmail.com> wrote:

> On Fri, Mar 18, 2016 at 9:14 PM, Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Fri, Mar 18, 2016 at 1:17 PM, Param Hanji 
>> wrote:
>>
>>> Hello,
>>>
>>> On Thu, Mar 17, 2016 at 4:57 AM Vasco Alexandre da Silva Costa <
>>> vasco.co...@gmail.com> wrote:
>>>
 On Wed, Mar 16, 2016 at 9:44 PM, Param Hanji <
 param.catchch...@gmail.com> wrote:

 You will need a lot of time to port bool.c so you need to schedule
 appropriately. That code is rife with gotos, structs with pointers, and
 dynamic memory allocation. We don't want any of that in OpenCL. The sooner
 you start looking into that code the better. I did some patches last summer
 to remove many gotos from the existing code but there are still several
 left.

 I suggest you read the presentation Sean linked to so you can get an
 idea for what boolean operations and CSG are:
 http://web.iitd.ac.in/~hegde/cad/lecture/L30_solidmod_basics.pdf

 The main functions of interest in bool.c are rt_bool_eval,
 rt_boolweave, and rt_boolfinal. rt_boolweave and rt_bool_final do dynamic
 memory allocations with linked lists but, if you read their code carefully,
 the maximum output size is bounded as a function of the input size. The
 input is the list of intersection points. The size of the list of
 intersection points is already being computed by rt.cl:count_hits().
 So you can pre allocate a chunk of memory with the maximum possible output
 size and pass that array to your functions.
 As for rt_bool_eval the boolean ops tree is stored as a tree of
 pointers to structs. Can't have that. The rt_bool_eval function uses gotos.
 Can't have those either.

>>>
>>> I'll start looking into the code as soon as i can. Is there any resource
>>> I can refer to get a brief high level understanding of how ray tracing
>>> occurs. I have no knowledge of computer graphics and even theoretical
>>> resources pertaining to the specific functions(eval, weave) would be
>>> helpful. I'll look out for some on my own too.
>>>
>>
>> If you want a brief idea of how the ray-tracing algorithm works you can
>> look at the relevant Wikipedia page. Wikipedia is a decent resource for
>> basic computer graphics knowledge:
>> https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29
>>
>> For knowing how CSG works, including the boolean ops, that lecture PDF is
>> a good resource.
>>
>>
>>> I started a patch in ANSI C to reimplement rt_bool_eval without gotos
>>> with a linearized tree, stored in an array, which can be easily copied to
>>> the compute device. You can find that patch here:
>>> https://sourceforge.net/p/brlcad/patches/417/
>>>
 The rt_bool_eval patch #417 is functional but it still has some warts
 in it.


>>> I noticed that you had proposed to design a new implementation of the
>>> boolean weave function in this pdf last year.
>>>
>>> https://drive.google.com/file/d/0B85Rkmt7rnCTZV9HNVIyZTRUMWM/view
>>>
>>> Was this discarded entirely? If not, does it make sense to change the
>>> way weave is performed currently to facilitate easy portability to OpenCL?
>>> Or should I just go about porting the existing code?
>>>
>>
>> That PDF you linked to is from a pre-proposal which was later changed
>> with output from Sean and the others. Eventually it was decided that we
>> would start with a first hit ray tracer and later on work on the boolean
>> evaluation proper to get working CSG. It just turns out that there was too
>> much effort involved in getting the object partitioning and the rendering
>> pipeline up to speed. Not to mention all those primitives... So I couldn't
>> finish work on boolean evaluation before the GSoC period ended. I just did
>> some cleanups (e.g. goto removal) on bool.c.
>>
>> Which is a good thing too or there would be little left to work on for
>> this GSoC. :-)
>>
>> Just ignore that PDF you got from Google Drive, which is something I
>> wrote before the GSoC 2015 period started, and read the advice I gave you
>> about how to tackle bool.c in this maling-list which includes the knowledge
>> I have now. I described a possible approach in detail here. I also said
>> which functions were most important (rt_bool_eval, rt_boolweave,
>> rt_bool_final)
>>
>
> PS: That project timeline in the PDF was shot down and I had to revise it.
> There was too much time doing research in it and not enough time actually
> coding. At the time I was unsure if the current bool weave algorithm
> BRL-CAD uses would make sense on a GPU or not. It turns out it does make
> sense but its like I said: you have to remove all the gotos, remove all
> pointers inside data structures, figure out the bounds of the 

Re: [brlcad-devel] An Explanation

2016-03-19 Thread Daniel Roßberg
Niks,

You may want to have a look at
https://lists.sourceforge.net/lists/listinfo/brlcad-devel
Unsubscribing your e-mail address from a mailing list is something you
should do by yourself.  Only in very special cases you could ask an
administrator.  (I'm not an administrator.)

Regards,
Daniel

2016-03-17 11:26 GMT+01:00 Niks Chaudhary :
> Plz remove me from this list

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] GSOC'16: Benchmark Performance Database

2016-03-19 Thread Ankesh Anand
Hi Raghav,

I worked on the project during GSOC '14. You can have a look at the
previous work here: https://github.com/BRL-CAD/benchmark. There has been a
significant work done on the project and if you are comfortable with the
tech stack in use, it would make sense to carry the work forward.

Regarding your questions,

- The project's backend is currently built with Python using the Django web
framework. It also uses a MySQL relational database. For visualizations,
the Flot visualization library has been used after much deliberation. (
https://github.com/BRL-CAD/benchmark/wiki/Selection-of-an-appropriate-Javascript-Charting-Library
)

- There are two methods in place already - a web based file upload of the
Benchmark logs and a command line interface to upload the log file (it's
basically a POST request to upload the file, so there is room for
improvement on that.)

- A search interface on historical performance data would definitely be
nice.

Let me know if you have any more questions.

Cheers!
-- 
Ankesh Anand
*Undergrad,Mathematics and Computing at*
*Indian Institute of Technology,Kharagpur*
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] An Explanation

2016-03-19 Thread Daniel Roßberg
> So there are three main obstacles that we have to achieve.
> 1. Identifying the objects (Either polygons or NURBS) separately instead of
> going into pixels of the image space

You need to learn the concept of ray-trace and ray-trace generated
images for comprehension.  Then "With a ray-trace you will get the
object's name which was hit." will make sense.

BTW, the objects are the solids, i.e. primitives or combinations of them.

> 2. Mapping the objects with their corresponding location. (I think I don't
> get this clearly though)

Mapping the objects with the corresponding locations of the image
points.  Do you know the difference between the objects location and
image point location?  Again, you need to understand how an image will
be created via ray-trace.

> 3. Using the location constructing splines (or 2d curves) for each
> identified objects. and that is the vector representation of each objects
> that we have identified.

You have a set of 2D points where you have to create the 2D curves
from (as a border of this set).

> this is what I got from the project description and your mail.
>
> Thank You
You're welcome,
Daniel

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 9:44 PM, Param Hanji 
wrote:

> Yeah sending the output to the file fixed it. I'll add in my
> implementation for epa and submit a patch soon.
>

Oh ok. If you don't define an output that will happen. Now I can reproduce
that issue here as well.
I updated to the latest BRL-CAD SVN trunk here and found a couple of
compilation issues which didn't happen in Aug 31 2015. Those should be
fixed now.

When you make your patch also get a screenshot of the output and post a
link to it. This is graphics rendering after all. :-)


>  Also, I was wondering if my GSOC proposal could include accelerating some
> more primitives(perhaps even all). This will buy me time to get use to the
> BRL-CAD codebase and also enable me to learn up about CSG and how the
> boolean evaluation is implemented. Parallelizing bool.c could happen later.
>

I agree that you should implement a couple of primitives in your proposal
but no more than 2-3. e.g. ETO and PART.

You will need a lot of time to port bool.c so you need to schedule
appropriately. That code is rife with gotos, structs with pointers, and
dynamic memory allocation. We don't want any of that in OpenCL. The sooner
you start looking into that code the better. I did some patches last summer
to remove many gotos from the existing code but there are still several
left.

I suggest you read the presentation Sean linked to so you can get an idea
for what boolean operations and CSG are:
http://web.iitd.ac.in/~hegde/cad/lecture/L30_solidmod_basics.pdf

The main functions of interest in bool.c are rt_bool_eval, rt_boolweave,
and rt_boolfinal. rt_boolweave and rt_bool_final do dynamic memory
allocations with linked lists but, if you read their code carefully, the
maximum output size is bounded as a function of the input size. The input
is the list of intersection points. The size of the list of intersection
points is already being computed by rt.cl:count_hits(). So you can pre
allocate a chunk of memory with the maximum possible output size and pass
that array to your functions.
As for rt_bool_eval the boolean ops tree is stored as a tree of pointers to
structs. Can't have that. The rt_bool_eval function uses gotos. Can't have
those either.

I started a patch in ANSI C to reimplement rt_bool_eval without gotos with
a linearized tree, stored in an array, which can be easily copied to the
compute device. You can find that patch here:
https://sourceforge.net/p/brlcad/patches/417/
The rt_bool_eval patch #417 is functional but it still has some warts in it.

Don't implement all the primitives since some are so complex you won't have
the time to do the boolean evaluation in GSoC which has higher priority.
e.g. porting PIPE alone could be half a GSoC project... Also don't
underestimate the effort it will take to implement boolean evaluation. The
code is not particularly long but its non-trivial to port to the OpenCL
programming model.

I also suggest you ignore the parts about FASTGEN support in bool.c, at
least to begin with, as it seems to be a legacy mode.

Still you should have the opinion from someone who's been here for longer
than me, like Sean, or Erik, or one of the other guys.

Regards,
-Vasco Costa



Just a thought. Thank you again.
>
> Best,
> Param
>
> On Thu, Mar 17, 2016 at 3:04 AM Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Wed, Mar 16, 2016 at 9:32 PM, Vasco Alexandre da Silva Costa <
>> vasco.co...@gmail.com> wrote:
>>
>>> On Wed, Mar 16, 2016 at 9:12 PM, Param Hanji >> > wrote:
>>>
 Yes, there was an error message on the terminal. Manually copying
 everything to my current directory worked. Compilation starts but throws a
 "pixel fb_write error". I think this is from rt/do.c from clt_run().

>>> That's weird. If you are outputting to a file it shouldn't try to use
>>> the frame buffer. The frame buffer is used to render to the screen inside
>>> the MGED interface. Did you use something like:
>>>
>>> make tgc tgc
>>> e tgc ; rt -z 1 -o rt_tgc.pix
>>>
>>> I think Sean said you could use .png instead of .pix as well.
>>>
>>> Or did you use the MGED interface instead of choosing an output file?
>>> Try both approaches.
>>>
>>> I'm really unfamiliar with this bit of code. Any idea how to fix this?

>>>
>>> I can't reproduce your issue here. Try the workarounds I suggested.
>>> fb_write is a wrapper around a bunch of possible backends so its
>>> possible you are hiting some poorly tested code path. I would need at least
>>> a GDB stack trace to start looking into it.
>>>
>>
>> i.e. it sounds like it rendered the image with OpenCL fine the problem is
>> with the output.
>>
>> --
>> Vasco Alexandre da Silva Costa
>> PhD in Computer Engineering (Computer Graphics)
>> Instituto Superior Técnico/University of Lisbon, Portugal
>>
>> --
>> Transform Data into Opportunity.
>> 

Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Christopher Sean Morrison
 --
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Thu, Mar 17, 2016 at 8:49 PM, Christopher Sean Morrison 
wrote:

>
>
> On Mar 17, 2016, at 03:55 PM, Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
> The problem is the material lighting code. The results are not the same.
> In OpenCL mode it renders that ehy in a really dark color and you nearly
> miss it. If you render the ehy in surface normals lighting mode (i.e. rt
> -z1 -l2) the output is as expected here.
>
>
> Ah, very good.  The -W command line option is good in a pinch for seeing
> dark objects vs black window -- makes the background white.
>

Neat! That clearly shows that there is a black solid in the render. Thanks!

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Debug Brl CAD source

2016-03-19 Thread Андрій Наюк
Hi.

What type of platform do you use? With what errors your configuration is
failing?

2016-03-17 12:52 GMT+02:00 Jawadh Salih Rifath 
:

> I have downloaded brlcad source to review and analyse for my project. But
> configuration is failing always. Is there any specific way to debug the
> code. I am not familiar with cmake.
>
> Please help me with this
>
> thanks
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 9:32 PM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Wed, Mar 16, 2016 at 9:12 PM, Param Hanji 
> wrote:
>
>> Yes, there was an error message on the terminal. Manually copying
>> everything to my current directory worked. Compilation starts but throws a
>> "pixel fb_write error". I think this is from rt/do.c from clt_run().
>>
> That's weird. If you are outputting to a file it shouldn't try to use the
> frame buffer. The frame buffer is used to render to the screen inside the
> MGED interface. Did you use something like:
>
> make tgc tgc
> e tgc ; rt -z 1 -o rt_tgc.pix
>
> I think Sean said you could use .png instead of .pix as well.
>
> Or did you use the MGED interface instead of choosing an output file? Try
> both approaches.
>
> I'm really unfamiliar with this bit of code. Any idea how to fix this?
>>
>
> I can't reproduce your issue here. Try the workarounds I suggested.
> fb_write is a wrapper around a bunch of possible backends so its possible
> you are hiting some poorly tested code path. I would need at least a GDB
> stack trace to start looking into it.
>

i.e. it sounds like it rendered the image with OpenCL fine the problem is
with the output.

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Debug Brl CAD source

2016-03-19 Thread Christopher Sean Morrison


> On Mar 17, 2016, at 12:55 PM, Jawadh Salih Rifath 
>  wrote:
> 
> Yeah I have done accordingly. But still it is not working. CMakeFile shows an 
> error.

It looks like you're using a source tarball instead of an svn checkout.  

Even if an svn checkout fails, I encourage you to diagnose and fix compilation 
errors as they are a normal aspect of ongoing development -- not only do they 
make a good patch submission (for which using svn trunk checkout is required) 
it will make you a more capable developer and it's a skill required for gsoc.

Cheers!
Sean
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] An Explanation

2016-03-19 Thread Niks Chaudhary
Plz remove me from this list
On 16-Mar-2016 1:20 pm, "Jawadh Salih Rifath" 
wrote:

> Please tel me what is meant by this.
> use the knowledge inherent in the ray about what object it's returning the
> pixel from to group pixels into groups based on objects. From there, the
> set of xy points in image space could be fitted with spline curves to
> produce vector representations.
>
> in http://brlcad.org/wiki/Vector_Drawings_from_NURBS.
>
> A big help.
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Debug Brl CAD source

2016-03-19 Thread Jawadh Salih Rifath
I first tried it using ubuntu 15.04 but it fails with the compilation. and
I used clion as the editor for linux but it did not work. And then I
shifted the code to windows (10) so I used CMake gui to configure with
visual studio 15 64bit. But when I configure it it shows me errors in CMake
files. Here are the errors.


There are some warnings. And below are the errors.


Quoted variables like "WIN32" will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
CMakeLists.txt:386 (CMAKEFILES)
C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226
(add_library)
src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:467 (_message):
Attempting to ignore non-existent file INTERFACE, in directory
H:/University/GSOC/2016/Sources/brlcad-7.24.2 -
Copy/src/other/xmltools/libxml
Call Stack (most recent call first):
misc/CMake/BRLCAD_CMakeFiles.cmake:137 (message)
CMakeLists.txt:386 (CMAKEFILES)
C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226
(add_library)
src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)



Please note : "H:/University/GSOC/2016/Sources/brlcad-7.24.2 - Copy" is my
path to the brl cad source.


Thank You .



On 17 March 2016 at 17:07, Андрій Наюк  wrote:

> Hi.
>
> What type of platform do you use? With what errors your configuration is
> failing?
>
> 2016-03-17 12:52 GMT+02:00 Jawadh Salih Rifath <
> jawadhsalih.wo...@gmail.com>:
>
>> I have downloaded brlcad source to review and analyse for my project. But
>> configuration is failing always. Is there any specific way to debug the
>> code. I am not familiar with cmake.
>>
>> Please help me with this
>>
>> thanks
>>
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>> ___
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 9:12 PM, Param Hanji 
wrote:

> Yes, there was an error message on the terminal. Manually copying
> everything to my current directory worked. Compilation starts but throws a
> "pixel fb_write error". I think this is from rt/do.c from clt_run().
>
That's weird. If you are outputting to a file it shouldn't try to use the
frame buffer. The frame buffer is used to render to the screen inside the
MGED interface. Did you use something like:

make tgc tgc
e tgc ; rt -z 1 -o rt_tgc.pix

I think Sean said you could use .png instead of .pix as well.

Or did you use the MGED interface instead of choosing an output file? Try
both approaches.

I'm really unfamiliar with this bit of code. Any idea how to fix this?
>

I can't reproduce your issue here. Try the workarounds I suggested.
fb_write is a wrapper around a bunch of possible backends so its possible
you are hiting some poorly tested code path. I would need at least a GDB
stack trace to start looking into it.

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] REF: Help Understand the Code.

2016-03-19 Thread benson chepkwony
Hi Costa,I have a question!
What version of OpenCL version does the Brlcad applications renders on?

If my computer has a different version does it matter or it get supported?

I installed OpenCL 2.0 (Version) including; All the CL/.. header files. Because 
currently my computer is;
Windows 10, and comes with OPENCL 2.0.4.0 drivers.
Do I have to ADD any Path to the Environment and/or to IDE to point to the 
OpenCL Library/bin?  

Since Windows 10 comes with OpenCL 2.0.4.0 drivers, I guess this is compatible 
with an AMD NVIDIA card and I should not have to worry about the Nvidia card 
version.

Do I have to set OpenCL Environment Variable in the computer system to EQUAL 
the number of Processors?
How many Platforms are there in GPU or computer? is that suppose to be equal to 
the number of processors?

And can you also explain more about the boolean Evaluation and the Constructive 
Solid Geometry(CSG) operations. And what needs to be done here?

Thanks.

From,
Benson Chepkwony

 

On Sunday, March 13, 2016 4:53 PM, Vasco Alexandre da Silva Costa 
 wrote:
 

 On Sun, Mar 13, 2016 at 2:23 AM, benson chepkwony  wrote:

  HI Costa,
 I have performed mid-level programming on concurrency, threading and 
parallelism. With pThreads, OpenMP and Java threading. However I am new to 
OpenCL. 
 
 OpenCL requires similar threading techniques if I am not wrong.


Not really. I guess you did not read the article about SIMT I linked to.
 
 And I was going to ask you, if tuning the application or C/C++ code into a 
parallel code is important? by that, I mean conducting; optimization, 
eliminating dependency(i.e True, Anti, ..), Loops transformation, Data 
transformation, Aliasing issues, Anti-aliasing etc.
 
 Is there a specific Target area you should identify in your code? that needs 
to be implemented for OpenCL platform. Such as an Algorithm, Loops, functions, 
input/output readers etc. And how do you determine this particular Target area? 


I am not going to teach you how to program in OpenCL. Or the differences 
between C and OpenCL. It's expected that you learn that by yourself. I even 
provided you with some links to resources on the topic which you seem to have 
ignored...
 
 I have been familiarizing myself with OpenCL and I have a few questions. 
 Are we targeting the GPU on this project?


The targets are GPUs and multi-core CPUs. So yes.
 
 Are we therefore conducting GPU programming with OpenCL?
 
 I was wondering if this is the OpenCL procedure, that we should follow on this 
project.
 - There a two kinds of OpenCL process:
 Kernel Code program
 Host Code program
 
 - OpenCL Host Program Procedure:
 Define platform and Queues
 Define Memory objects
 Create the program
 Build the program
 Create and setup kernel
 Execute the kernel
 Read results back to the host
 
 So here our biggest task is identifying routines, functions, algorithms and 
loops on Brl-cad Primitives i.e ETO that needs to be implemented and modified 
to performs its work/task under OpenCL Platform? Then identifying OpenCL Memory 
Objects, Work-Items, etc.
 
 How do you identify these primitives`s functions and algorithms?


That's supposed to be your job... i.e. read the BRL-CAD code and understand it. 
I'm only here to provide you with pointers and guide you along the way.
 
 And for this project we are looking for Work-Items and Work-Groups in 
primitives c codes that can be computed concurrently under OpenCL GPU Platform.
 
 Thanks.
 
 From,
 Benson Chepkwony
 
 
 
 
 On 3/10/2016 12:10 PM, Vasco Alexandre da Silva Costa wrote:
  
   On Thu, Mar 10, 2016 at 3:51 AM, benson chepkwony  wrote:
 
  Hi Costa,
 Are we suppose to be "Porting" these primitives the(RHC, ARB4, DSP, EXTRUDE 
etc) from its current rendering structure to OpenCL?
 Is there any compatible issues with moving these primitives to OpenCL? 
 In order to "Port" these pimitives are we going to just "read in" their 
extensions to OpenCL?
  
 
  I think I already gave you enough info so you can work on a patch. Rome 
wasn't built on a day. You need to focus on an achievable task. Focus on one 
primitive for now. I suggested one.
  
 OpenCL is not C compatible so yes there will be issues porting the code over. 
The syntax is C like but OpenCL is a language designed for parallel programming 
in a SIMT fashion. I you want to know more about OpenCL you can go to 
www.khronos.org. They have online an overview reference card of the language so 
people already familiar with C and graphics programming can get a quick start:
 https://www.khronos.org/files/opencl-1-2-quick-reference-card.pdf.
    
  I was also looking at your "Milestone" on your logs and you wanted to 
implement HLBVH acceleration structure with the Bounding Volume Hierarchy to 
traverse the ray packets. Did you actually implemented this acceleration 
structure? 
  
 
  The HLBVH is in BRL-CAD SVN trunk. It is currently built on the CPU as a 
pre-processing 

Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
Hello,

On Thu, Mar 17, 2016 at 4:57 AM Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Wed, Mar 16, 2016 at 9:44 PM, Param Hanji 
> wrote:
>
> You will need a lot of time to port bool.c so you need to schedule
> appropriately. That code is rife with gotos, structs with pointers, and
> dynamic memory allocation. We don't want any of that in OpenCL. The sooner
> you start looking into that code the better. I did some patches last summer
> to remove many gotos from the existing code but there are still several
> left.
>
> I suggest you read the presentation Sean linked to so you can get an idea
> for what boolean operations and CSG are:
> http://web.iitd.ac.in/~hegde/cad/lecture/L30_solidmod_basics.pdf
>
> The main functions of interest in bool.c are rt_bool_eval, rt_boolweave,
> and rt_boolfinal. rt_boolweave and rt_bool_final do dynamic memory
> allocations with linked lists but, if you read their code carefully, the
> maximum output size is bounded as a function of the input size. The input
> is the list of intersection points. The size of the list of intersection
> points is already being computed by rt.cl:count_hits(). So you can pre
> allocate a chunk of memory with the maximum possible output size and pass
> that array to your functions.
> As for rt_bool_eval the boolean ops tree is stored as a tree of pointers
> to structs. Can't have that. The rt_bool_eval function uses gotos. Can't
> have those either.
>

I'll start looking into the code as soon as i can. Is there any resource I
can refer to get a brief high level understanding of how ray tracing
occurs. I have no knowledge of computer graphics and even theoretical
resources pertaining to the specific functions(eval, weave) would be
helpful. I'll look out for some on my own too.

>
> I started a patch in ANSI C to reimplement rt_bool_eval without gotos with
> a linearized tree, stored in an array, which can be easily copied to the
> compute device. You can find that patch here:
> https://sourceforge.net/p/brlcad/patches/417/
> The rt_bool_eval patch #417 is functional but it still has some warts in
> it.
>
>
I noticed that you had proposed to design a new implementation of the
boolean weave function in this pdf last year.

https://drive.google.com/file/d/0B85Rkmt7rnCTZV9HNVIyZTRUMWM/view

Was this discarded entirely? If not, does it make sense to change the way
weave is performed currently to facilitate easy portability to OpenCL? Or
should I just go about porting the existing code?

Best,
Param
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 8:26 PM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Wed, Mar 16, 2016 at 8:15 PM, Param Hanji 
> wrote:
>
>> Hi Vasco Costa,
>>
>> Yes -z 1 did it. :)
>>
>> Now fopen() throws an error! Function clt_read_code() in
>> primitiive_util.c fopen() returns a NULL. I included  and printed
>> the error as described here
>>
>>
>> http://stackoverflow.com/questions/8633909/what-is-the-reason-for-fopens-failure-to-open-a-file
>>
>> The error is 2 which means "No such file or directory" according to
>>
>> http://www.thegeekstuff.com/2010/10/linux-error-codes/
>>
>> This is rather puzzling because I can see solver.cl present in the same
>> directory as primitive_util.c. Moreover, fopen() is a function that I've
>> used time and time again and I haven't this kind of error before. I also
>> verified that the file has read access.
>>
>> Thank you for your patience! I'm just running into issue after issue. I
>> really appreciate your guidance.
>>
>
> Yeah the OpenCL support is kind of experimental. More than half of the
> trouble is getting OpenCL itself to be properly configured on your system.
> I expect the distros to eventually get that right but it's sure taking a
> while.
>
> I know what's the problem here. It's searching for the .cl files to
> compile at run-time. The .cl files are supposed to be installed to some
> directory in the current path.
>
> Just manually copy or link the .cl files to your current directory '.'.
> The list of .cl files you need to copy or link to is:
> solver.cl
>
> arb8_shot.cl
> bot_shot.cl
> ehy_shot.cl
> ell_shot.cl
> sph_shot.cl
> rec_shot.cl
> tgc_shot.cl
> tor_shot.cl
>
> rt.cl
>


> The current paths should be something like librt/primitives/*.cl ,
> librt/primitives/*/*_shot.cl
> You should just place them all in the current directory.
>

PS: This should be improved with some kind of smart way to find the
directory where the files are in, or at least by looking the directory up
in an environment variable, but the current clt_init and clt_read_code
aren't that smart. You should have got some output error message like
"failed to read OpenCL code file (solver.c)".


>
>
>> Best,
>> Param
>>
>> On Thu, Mar 17, 2016 at 1:15 AM Vasco Alexandre da Silva Costa <
>> vasco.co...@gmail.com> wrote:
>>
>>> On Wed, Mar 16, 2016 at 7:36 PM, Vasco Alexandre da Silva Costa <
>>> vasco.co...@gmail.com> wrote:
>>>
 On Wed, Mar 16, 2016 at 7:28 PM, Param Hanji <
 param.catchch...@gmail.com> wrote:

> Hi,
>
> Installing the AMD SDK gave me OpenCL 1.2 support. I managed to
> configure cmake using cmake-gui and built successfully. But raytrace still
> doesn't happen on my GPU. By adding fprintf statements, I found out that
> execution does indeed enter the #ifdef USE_OPENCL block at rt/main.c.
> However the if following block (if (opencl_mode)) is not entered.
>
> opencl_mode is set at opt.c at case: 'z'. I still don't know why its
> value doesn't change even if use -z option.
>

 I think it is '-z 1'. The '-z' option currently requires a numeric
 argument.
 '1' to enable OpenCL mode and '0' to disable it.

>>>
>>> The code is like this (opt.c):
>>>
>>> case 'z':
>>> opencl_mode = atoi( bu_optarg );
>>> break;
>>>
>>> I did it this way because I added a toggle button in the MGED File ->
>>> Raytrace panel where you can enable or disable OpenCL mode. The toggle is
>>> either '0' or '1' depending on its status.
>>>
>>> --
>>> Vasco Alexandre da Silva Costa
>>> PhD in Computer Engineering (Computer Graphics)
>>> Instituto Superior Técnico/University of Lisbon, Portugal
>>>
>>> --
>>> Transform Data into Opportunity.
>>> Accelerate data analysis in your applications with
>>> Intel Data Analytics Acceleration Library.
>>> Click to learn more.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>>> ___
>>> BRL-CAD Developer mailing list
>>> brlcad-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>> ___
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>>
>
>
> --
> Vasco Alexandre da Silva Costa
> PhD in Computer Engineering (Computer Graphics)
> Instituto Superior Técnico/University of Lisbon, Portugal
>



-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior 

Re: [brlcad-devel] Debug Brl CAD source

2016-03-19 Thread Margaret Hu
I can successfully download and compile on Ubuntu 14.04, I suggest the
following procedure

0. install Ubuntu 14.04 LTS, make sure you have svn, g++, make, cmake (by
sudo apt-get install ...)
1. svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad
2. cd brlcad and examine the CMakeLists.txt , you will notice the following
line
  # configuration build tools.  We want only two - Debug and Release.
3. mkdir build; cd build; (please create a ~/local directory before you
issue the following command)
  cmake .. -DCMAKE_INSTALL_PREFIX=~/local/rel-7.25.0
-DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug
now you should have a Makefile in your build directory
4. just type (in the build directory)
make

you should see
BRL-CAD Release 7.25.0, Build 20160308

5. now type
make test

you should see
The following tests FAILED:
   1 - NOTE: some 'test' tests are expected to fail, 'regress' must pass
(Failed)
 766 - regress-flawfinder (Failed)
 771 - regress-quote (Failed)
 772 - regress-rtwizard (Failed)
Errors while running CTest

6. now type
make install

cd ~/local
you should see
bin  etc  include  lib  share





On Thu, Mar 17, 2016 at 5:19 AM, Андрій Наюк  wrote:

> Did you read INSTALL and doc\README.Windows files? There are specified the
> versions of software you should use and the steps to build the program. I
> successfully configured and compiled the code on Windows 7 with Visual
> Studio 13 and CMake 3.5.0.
> Also it should be mentioned that I changed default settings:
> CMAKE_BUILD_TYPE entry I set to Debug and BRLCAD_BUNDLED_LIBS to BUNDLED.
>
> 2016-03-17 13:54 GMT+02:00 Jawadh Salih Rifath <
> jawadhsalih.wo...@gmail.com>:
>
>> I first tried it using ubuntu 15.04 but it fails with the compilation.
>> and I used clion as the editor for linux but it did not work. And then I
>> shifted the code to windows (10) so I used CMake gui to configure with
>> visual studio 15 64bit. But when I configure it it shows me errors in CMake
>> files. Here are the errors.
>>
>>
>> There are some warnings. And below are the errors.
>>
>>
>> Quoted variables like "WIN32" will no longer be dereferenced when the
>> policy is set to NEW. Since the policy is not set the OLD behavior will be
>> used.
>> Call Stack (most recent call first):
>> CMakeLists.txt:386 (CMAKEFILES)
>> C:/Program Files
>> (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226 (add_library)
>> src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
>> This warning is for project developers. Use -Wno-dev to suppress it.
>>
>> CMake Error at CMakeLists.txt:467 (_message):
>> Attempting to ignore non-existent file INTERFACE, in directory
>> H:/University/GSOC/2016/Sources/brlcad-7.24.2 -
>> Copy/src/other/xmltools/libxml
>> Call Stack (most recent call first):
>> misc/CMake/BRLCAD_CMakeFiles.cmake:137 (message)
>> CMakeLists.txt:386 (CMAKEFILES)
>> C:/Program Files
>> (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226 (add_library)
>> src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
>>
>>
>>
>> Please note : "H:/University/GSOC/2016/Sources/brlcad-7.24.2 - Copy" is
>> my path to the brl cad source.
>>
>>
>> Thank You .
>>
>>
>>
>> On 17 March 2016 at 17:07, Андрій Наюк  wrote:
>>
>>> Hi.
>>>
>>> What type of platform do you use? With what errors your configuration is
>>> failing?
>>>
>>> 2016-03-17 12:52 GMT+02:00 Jawadh Salih Rifath <
>>> jawadhsalih.wo...@gmail.com>:
>>>
 I have downloaded brlcad source to review and analyse for my project.
 But configuration is failing always. Is there any specific way to debug the
 code. I am not familiar with cmake.

 Please help me with this

 thanks



 --
 Transform Data into Opportunity.
 Accelerate data analysis in your applications with
 Intel Data Analytics Acceleration Library.
 Click to learn more.
 http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
 ___
 BRL-CAD Developer mailing list
 brlcad-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/brlcad-devel


>>>
>>>
>>> --
>>> Transform Data into Opportunity.
>>> Accelerate data analysis in your applications with
>>> Intel Data Analytics Acceleration Library.
>>> Click to learn more.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>>> ___
>>> BRL-CAD Developer mailing list
>>> brlcad-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>
>>>
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> 

Re: [brlcad-devel] An Explanation

2016-03-19 Thread Jawadh Salih Rifath
I am sorry for asking this. I searched sources to get the idea of ray trace
but I couldn't. So please give me a source to get the idea of ray trace.
You have mentioned that look at view.c and viewedge.c . I failed to find
any algorithm of raytrace. please guide me

thank you

On 16 March 2016 at 23:28, Jawadh Salih Rifath 
wrote:

> Got it sir. I'll get if anything.
> Thank you.
> On 16 Mar 2016 17:35, "Daniel Roßberg"  wrote:
>
>> > So there are three main obstacles that we have to achieve.
>> > 1. Identifying the objects (Either polygons or NURBS) separately
>> instead of
>> > going into pixels of the image space
>>
>> You need to learn the concept of ray-trace and ray-trace generated
>> images for comprehension.  Then "With a ray-trace you will get the
>> object's name which was hit." will make sense.
>>
>> BTW, the objects are the solids, i.e. primitives or combinations of them.
>>
>> > 2. Mapping the objects with their corresponding location. (I think I
>> don't
>> > get this clearly though)
>>
>> Mapping the objects with the corresponding locations of the image
>> points.  Do you know the difference between the objects location and
>> image point location?  Again, you need to understand how an image will
>> be created via ray-trace.
>>
>> > 3. Using the location constructing splines (or 2d curves) for each
>> > identified objects. and that is the vector representation of each
>> objects
>> > that we have identified.
>>
>> You have a set of 2D points where you have to create the 2D curves
>> from (as a border of this set).
>>
>> > this is what I got from the project description and your mail.
>> >
>> > Thank You
>> You're welcome,
>> Daniel
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>> ___
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] An Explanation

2016-03-19 Thread Daniel Roßberg
https://en.wikipedia.org/wiki/Ray_trace
for example

Daniel

2016-03-17 7:47 GMT+01:00 Jawadh Salih Rifath :
> I am sorry for asking this. I searched sources to get the idea of ray trace
> but I couldn't. So please give me a source to get the idea of ray trace. You
> have mentioned that look at view.c and viewedge.c . I failed to find any
> algorithm of raytrace. please guide me
>
> thank you
>
> On 16 March 2016 at 23:28, Jawadh Salih Rifath 
> wrote:
>>
>> Got it sir. I'll get if anything.
>> Thank you.
>>
>> On 16 Mar 2016 17:35, "Daniel Roßberg"  wrote:
>>>
>>> > So there are three main obstacles that we have to achieve.
>>> > 1. Identifying the objects (Either polygons or NURBS) separately
>>> > instead of
>>> > going into pixels of the image space
>>>
>>> You need to learn the concept of ray-trace and ray-trace generated
>>> images for comprehension.  Then "With a ray-trace you will get the
>>> object's name which was hit." will make sense.
>>>
>>> BTW, the objects are the solids, i.e. primitives or combinations of them.
>>>
>>> > 2. Mapping the objects with their corresponding location. (I think I
>>> > don't
>>> > get this clearly though)
>>>
>>> Mapping the objects with the corresponding locations of the image
>>> points.  Do you know the difference between the objects location and
>>> image point location?  Again, you need to understand how an image will
>>> be created via ray-trace.
>>>
>>> > 3. Using the location constructing splines (or 2d curves) for each
>>> > identified objects. and that is the vector representation of each
>>> > objects
>>> > that we have identified.
>>>
>>> You have a set of 2D points where you have to create the 2D curves
>>> from (as a border of this set).
>>>
>>> > this is what I got from the project description and your mail.
>>> >
>>> > Thank You
>>> You're welcome,
>>> Daniel
>>>
>>>
>>> --
>>> Transform Data into Opportunity.
>>> Accelerate data analysis in your applications with
>>> Intel Data Analytics Acceleration Library.
>>> Click to learn more.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>>> ___
>>> BRL-CAD Developer mailing list
>>> brlcad-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 7:36 PM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Wed, Mar 16, 2016 at 7:28 PM, Param Hanji 
> wrote:
>
>> Hi,
>>
>> Installing the AMD SDK gave me OpenCL 1.2 support. I managed to configure
>> cmake using cmake-gui and built successfully. But raytrace still doesn't
>> happen on my GPU. By adding fprintf statements, I found out that execution
>> does indeed enter the #ifdef USE_OPENCL block at rt/main.c. However the if
>> following block (if (opencl_mode)) is not entered.
>>
>> opencl_mode is set at opt.c at case: 'z'. I still don't know why its
>> value doesn't change even if use -z option.
>>
>
> I think it is '-z 1'. The '-z' option currently requires a numeric
> argument.
> '1' to enable OpenCL mode and '0' to disable it.
>

The code is like this (opt.c):

case 'z':
opencl_mode = atoi( bu_optarg );
break;

I did it this way because I added a toggle button in the MGED File ->
Raytrace panel where you can enable or disable OpenCL mode. The toggle is
either '0' or '1' depending on its status.

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


[brlcad-devel] Introducing myself

2016-03-19 Thread Gauravjeet Singh
Many of you already know me here. My name is Gauravjeet Singh.
I was welcomed in this community in late 2012 via Google Code In (GCI).
I was a GCI 2012 student and then acted as a GCI mentor of BRL-CAD for
next two consecutive years (2013 & 2014).

Now I am willing to code with this community via GSoC 16.

I am looking for a project to work with.

OGV has always been successful in taking my attention for a number of
reasons. Biggest reason being it in meteor
I have quite a good experience with meteor framework. Have been
contributing to few meteor repositories from past year.

I am looking into OGV bugs in order to send a patch (PR).

Another project that got my attention is Qt UI for BRL-CAD.
I have some experience with Qt and Wt(similar to Qt, can be referred
as Qt for the web). But I don't have much exposure to BRL-CAD code. So
that worries me a little.

Any greetings, comments or suggestions are highly welcomed. :)


-- 
Fear is wisdom in the face of danger. It’s nothing to be ashamed of

Gauravjeet Singh
http://github.com/gauravjeetsingh

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Wed, Mar 16, 2016 at 8:15 PM, Param Hanji 
wrote:

> Hi Vasco Costa,
>
> Yes -z 1 did it. :)
>
> Now fopen() throws an error! Function clt_read_code() in primitiive_util.c
> fopen() returns a NULL. I included  and printed the error as
> described here
>
>
> http://stackoverflow.com/questions/8633909/what-is-the-reason-for-fopens-failure-to-open-a-file
>
> The error is 2 which means "No such file or directory" according to
>
> http://www.thegeekstuff.com/2010/10/linux-error-codes/
>
> This is rather puzzling because I can see solver.cl present in the same
> directory as primitive_util.c. Moreover, fopen() is a function that I've
> used time and time again and I haven't this kind of error before. I also
> verified that the file has read access.
>
> Thank you for your patience! I'm just running into issue after issue. I
> really appreciate your guidance.
>

Yeah the OpenCL support is kind of experimental. More than half of the
trouble is getting OpenCL itself to be properly configured on your system.
I expect the distros to eventually get that right but it's sure taking a
while.

I know what's the problem here. It's searching for the .cl files to compile
at run-time. The .cl files are supposed to be installed to some directory
in the current path.

Just manually copy or link the .cl files to your current directory '.'. The
list of .cl files you need to copy or link to is:

solver.cl
arb8_shot.clbot_shot.clehy_shot.clell_shot.clsph_shot.clrec_shot.cltgc_shot.cltor_shot.cl
rt.cl

The current paths should be something like librt/primitives/*.cl ,
librt/primitives/*/*_shot.cl
You should just place them all in the current directory.


> Best,
> Param
>
> On Thu, Mar 17, 2016 at 1:15 AM Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Wed, Mar 16, 2016 at 7:36 PM, Vasco Alexandre da Silva Costa <
>> vasco.co...@gmail.com> wrote:
>>
>>> On Wed, Mar 16, 2016 at 7:28 PM, Param Hanji >> > wrote:
>>>
 Hi,

 Installing the AMD SDK gave me OpenCL 1.2 support. I managed to
 configure cmake using cmake-gui and built successfully. But raytrace still
 doesn't happen on my GPU. By adding fprintf statements, I found out that
 execution does indeed enter the #ifdef USE_OPENCL block at rt/main.c.
 However the if following block (if (opencl_mode)) is not entered.

 opencl_mode is set at opt.c at case: 'z'. I still don't know why its
 value doesn't change even if use -z option.

>>>
>>> I think it is '-z 1'. The '-z' option currently requires a numeric
>>> argument.
>>> '1' to enable OpenCL mode and '0' to disable it.
>>>
>>
>> The code is like this (opt.c):
>>
>>  case 'z':
>>  opencl_mode = atoi( bu_optarg );
>>  break;
>>
>> I did it this way because I added a toggle button in the MGED File ->
>> Raytrace panel where you can enable or disable OpenCL mode. The toggle is
>> either '0' or '1' depending on its status.
>>
>> --
>> Vasco Alexandre da Silva Costa
>> PhD in Computer Engineering (Computer Graphics)
>> Instituto Superior Técnico/University of Lisbon, Portugal
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>> ___
>> BRL-CAD Developer mailing list
>> brlcad-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>


-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Thu, Mar 17, 2016 at 7:47 PM, Christopher Sean Morrison 
wrote:

>
>
> On Mar 17, 2016, at 05:33 AM, Param Hanji 
> wrote:
>
> Great. I'm happy to help!
> Also is ehy running fine in OpenCL mode? My generated PNG is just a blank
> black screen with no figure. The terminal logs don't seem to indicate
> anything wrong. Maybe ehy_shot.cl has a bug?
>
>
> 1) Does that exact same ehy render correctly in non-OpenCL mode?
> 2) Does another primitive (e.g., an ell via mged> make ell ell) render
> correctly in OpenCL mode
>

The problem is the material lighting code. The results are not the same. In
OpenCL mode it renders that ehy in a really dark color and you nearly miss
it. If you render the ehy in surface normals lighting mode (i.e. rt -z1
-l2) the output is as expected here.

>
> Cheers!
> Sean
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>


-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


[brlcad-devel] GSOC Propsal Review

2016-03-19 Thread Param Hanji
Hello all,

Here's a link to the first draft of my GSOC propsal. Kindly have a look at
it and let me know what you think. :)

https://docs.google.com/document/d/1kyVGZAqAKm-scHCUFBQrB2nyrG20xRTOINSMAQtPC6I/edit?usp=sharing

Thank You
Param Hanji
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] GSoC Patch ideas

2016-03-19 Thread Shubham Chauhan
I would like to use this thread to inform everyone related to OGV as a GSoC
2016 project (students, mentors, previous students and mentors) that the
task list or the TODO list for Online Geometry Viewer has been updated
here: http://brlcad.org/wiki/Online_Geometry/TODO
Although previous content has not been deleted, but an update for each of
the previous task has been added, so that everyone can be on the same page.
There is a separate table for the new set of tasks and major bugs which has
been maintained on the page. Please go through this page while making any
development on OGV.

Open to suggestions for edits!


On Fri, Mar 18, 2016 at 2:16 AM, Christopher Sean Morrison 
wrote:

> GSoC students,
>
> If some of you are looking for a good patch you can work on and your
> project involves working with our C/C++ code, you might find one of the
> tasks listed in the src/libged/TODO file manageable.  There are obviously a
> lot of easy ideas in the top-level TODO file as well that vary more wildly
> in terms of complexity, but there is a libged section that is similarly
> filled with relatively easy tasks.
>
> Cheers!
> Sean
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>


-- 
Regards
Shubham Chauhan
2013099
B.Tech CSE
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
On Thu, Mar 17, 2016 at 7:54 PM, Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> On Thu, Mar 17, 2016 at 7:47 PM, Christopher Sean Morrison  > wrote:
>
>>
>>
>> On Mar 17, 2016, at 05:33 AM, Param Hanji 
>> wrote:
>>
>> Great. I'm happy to help!
>> Also is ehy running fine in OpenCL mode? My generated PNG is just a blank
>> black screen with no figure. The terminal logs don't seem to indicate
>> anything wrong. Maybe ehy_shot.cl has a bug?
>>
>>
>> 1) Does that exact same ehy render correctly in non-OpenCL mode?
>> 2) Does another primitive (e.g., an ell via mged> make ell ell) render
>> correctly in OpenCL mode
>>
>
> The problem is the material lighting code. The results are not the same.
> In OpenCL mode it renders that ehy in a really dark color and you nearly
> miss it. If you render the ehy in surface normals lighting mode (i.e. rt
> -z1 -l2) the output is as expected here.
>

The problem was more complicated that I thought. It turns out the OpenCL
code was calling the ehy normal computation routine more than once. It
turns out that routine (ehy_norm) both depends on hit_vpriv to compute the
proper normal, and clobbers hit_vpriv after normal computation to store
some temporary value for later computation of curvatures.
It just so happens that this only happened in the Full lighting mode.

I put a fix for this on SVN trunk.

-- 
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Vasco Alexandre da Silva Costa
It doesn't compile. It seems you forgot a function declaration in a header
file:

.../brlcad/trunk/src/librt/primitives/primitive_util.c: In function
‘clt_solid_pack’:
.../brlcad/trunk/src/librt/primitives/primitive_util.c:648:25: error:
implicit declaration of function ‘clt_epa_pack’
[-Werror=implicit-function-declaration]
  case ID_EPA:size = clt_epa_pack(pool, stp); break;
 ^


On Sat, Mar 19, 2016 at 1:03 PM, Param Hanji 
wrote:

> Here's the new patch.
>
>
> On Sat, Mar 19, 2016 at 6:32 PM Param Hanji 
> wrote:
>
>> Oops I did manually edit the patch. I ran diff again and uploaded the
>> patch without changes. I also changed the ID used to 19.
>>
>> On Sat 19 Mar, 2016, 2:51 AM Vasco Alexandre da Silva Costa, <
>> vasco.co...@gmail.com> wrote:
>>
>>> On Fri, Mar 18, 2016 at 9:14 PM, Vasco Alexandre da Silva Costa <
>>> vasco.co...@gmail.com> wrote:
>>>
 On Fri, Mar 18, 2016 at 1:17 PM, Param Hanji <
 param.catchch...@gmail.com> wrote:

> Hello,
>
> On Thu, Mar 17, 2016 at 4:57 AM Vasco Alexandre da Silva Costa <
> vasco.co...@gmail.com> wrote:
>
>> On Wed, Mar 16, 2016 at 9:44 PM, Param Hanji <
>> param.catchch...@gmail.com> wrote:
>>
>> You will need a lot of time to port bool.c so you need to schedule
>> appropriately. That code is rife with gotos, structs with pointers, and
>> dynamic memory allocation. We don't want any of that in OpenCL. The 
>> sooner
>> you start looking into that code the better. I did some patches last 
>> summer
>> to remove many gotos from the existing code but there are still several
>> left.
>>
>> I suggest you read the presentation Sean linked to so you can get an
>> idea for what boolean operations and CSG are:
>> http://web.iitd.ac.in/~hegde/cad/lecture/L30_solidmod_basics.pdf
>>
>> The main functions of interest in bool.c are rt_bool_eval,
>> rt_boolweave, and rt_boolfinal. rt_boolweave and rt_bool_final do dynamic
>> memory allocations with linked lists but, if you read their code 
>> carefully,
>> the maximum output size is bounded as a function of the input size. The
>> input is the list of intersection points. The size of the list of
>> intersection points is already being computed by rt.cl:count_hits().
>> So you can pre allocate a chunk of memory with the maximum possible 
>> output
>> size and pass that array to your functions.
>> As for rt_bool_eval the boolean ops tree is stored as a tree of
>> pointers to structs. Can't have that. The rt_bool_eval function uses 
>> gotos.
>> Can't have those either.
>>
>
> I'll start looking into the code as soon as i can. Is there any
> resource I can refer to get a brief high level understanding of how ray
> tracing occurs. I have no knowledge of computer graphics and even
> theoretical resources pertaining to the specific functions(eval, weave)
> would be helpful. I'll look out for some on my own too.
>

 If you want a brief idea of how the ray-tracing algorithm works you can
 look at the relevant Wikipedia page. Wikipedia is a decent resource for
 basic computer graphics knowledge:
 https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29

 For knowing how CSG works, including the boolean ops, that lecture PDF
 is a good resource.


> I started a patch in ANSI C to reimplement rt_bool_eval without gotos
> with a linearized tree, stored in an array, which can be easily copied to
> the compute device. You can find that patch here:
> https://sourceforge.net/p/brlcad/patches/417/
>
>> The rt_bool_eval patch #417 is functional but it still has some warts
>> in it.
>>
>>
> I noticed that you had proposed to design a new implementation of the
> boolean weave function in this pdf last year.
>
> https://drive.google.com/file/d/0B85Rkmt7rnCTZV9HNVIyZTRUMWM/view
>
> Was this discarded entirely? If not, does it make sense to change the
> way weave is performed currently to facilitate easy portability to OpenCL?
> Or should I just go about porting the existing code?
>

 That PDF you linked to is from a pre-proposal which was later changed
 with output from Sean and the others. Eventually it was decided that we
 would start with a first hit ray tracer and later on work on the boolean
 evaluation proper to get working CSG. It just turns out that there was too
 much effort involved in getting the object partitioning and the rendering
 pipeline up to speed. Not to mention all those primitives... So I couldn't
 finish work on boolean evaluation before the GSoC period ended. I just did
 some cleanups (e.g. goto removal) on bool.c.

 Which is a good thing too or there would be little left to work on for
 this GSoC. :-)

Re: [brlcad-devel] Debug Brl CAD source

2016-03-19 Thread Margaret Hu
I see that in your error message you have

H:/University/GSOC/2016/Sources/brlcad-7.24.2 -

This does not look right, I have

BRL-CAD Release 7.25.0, Build 20160308

did you get the source from svn checkout?
if you try to compile from the downloaded tar.gz file it may not work.




On Thu, Mar 17, 2016 at 9:55 AM, Jawadh Salih Rifath <
jawadhsalih.wo...@gmail.com> wrote:

> Yeah I have done accordingly. But still it is not working. CMakeFile shows
> an error.
>
> On 17 March 2016 at 17:49, Андрій Наюк  wrote:
>
>> Did you read INSTALL and doc\README.Windows files? There are specified
>> the versions of software you should use and the steps to build the program.
>> I successfully configured and compiled the code on Windows 7 with Visual
>> Studio 13 and CMake 3.5.0.
>> Also it should be mentioned that I changed default settings:
>> CMAKE_BUILD_TYPE entry I set to Debug and BRLCAD_BUNDLED_LIBS to BUNDLED.
>>
>> 2016-03-17 13:54 GMT+02:00 Jawadh Salih Rifath <
>> jawadhsalih.wo...@gmail.com>:
>>
>>> I first tried it using ubuntu 15.04 but it fails with the compilation.
>>> and I used clion as the editor for linux but it did not work. And then I
>>> shifted the code to windows (10) so I used CMake gui to configure with
>>> visual studio 15 64bit. But when I configure it it shows me errors in CMake
>>> files. Here are the errors.
>>>
>>>
>>> There are some warnings. And below are the errors.
>>>
>>>
>>> Quoted variables like "WIN32" will no longer be dereferenced when the
>>> policy is set to NEW. Since the policy is not set the OLD behavior will
>>> be
>>> used.
>>> Call Stack (most recent call first):
>>> CMakeLists.txt:386 (CMAKEFILES)
>>> C:/Program Files
>>> (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226 (add_library)
>>> src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
>>> This warning is for project developers. Use -Wno-dev to suppress it.
>>>
>>> CMake Error at CMakeLists.txt:467 (_message):
>>> Attempting to ignore non-existent file INTERFACE, in directory
>>> H:/University/GSOC/2016/Sources/brlcad-7.24.2 -
>>> Copy/src/other/xmltools/libxml
>>> Call Stack (most recent call first):
>>> misc/CMake/BRLCAD_CMakeFiles.cmake:137 (message)
>>> CMakeLists.txt:386 (CMAKEFILES)
>>> C:/Program Files
>>> (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226 (add_library)
>>> src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
>>>
>>>
>>>
>>> Please note : "H:/University/GSOC/2016/Sources/brlcad-7.24.2 - Copy" is
>>> my path to the brl cad source.
>>>
>>>
>>> Thank You .
>>>
>>>
>>>
>>> On 17 March 2016 at 17:07, Андрій Наюк  wrote:
>>>
 Hi.

 What type of platform do you use? With what errors your configuration
 is failing?

 2016-03-17 12:52 GMT+02:00 Jawadh Salih Rifath <
 jawadhsalih.wo...@gmail.com>:

> I have downloaded brlcad source to review and analyse for my project.
> But configuration is failing always. Is there any specific way to debug 
> the
> code. I am not familiar with cmake.
>
> Please help me with this
>
> thanks
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
>


 --
 Transform Data into Opportunity.
 Accelerate data analysis in your applications with
 Intel Data Analytics Acceleration Library.
 Click to learn more.
 http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
 ___
 BRL-CAD Developer mailing list
 brlcad-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/brlcad-devel


>>>
>>>
>>> --
>>> Transform Data into Opportunity.
>>> Accelerate data analysis in your applications with
>>> Intel Data Analytics Acceleration Library.
>>> Click to learn more.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
>>> ___
>>> BRL-CAD Developer mailing list
>>> brlcad-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>>>
>>>
>>
>>
>> --
>> Transform Data into Opportunity.
>> Accelerate data analysis in your applications with
>> Intel Data Analytics Acceleration Library.
>> Click to learn more.
>> 

Re: [brlcad-devel] An Explanation

2016-03-19 Thread Jawadh Salih Rifath
Got it sir. I'll get if anything.
Thank you.
On 16 Mar 2016 17:35, "Daniel Roßberg"  wrote:

> > So there are three main obstacles that we have to achieve.
> > 1. Identifying the objects (Either polygons or NURBS) separately instead
> of
> > going into pixels of the image space
>
> You need to learn the concept of ray-trace and ray-trace generated
> images for comprehension.  Then "With a ray-trace you will get the
> object's name which was hit." will make sense.
>
> BTW, the objects are the solids, i.e. primitives or combinations of them.
>
> > 2. Mapping the objects with their corresponding location. (I think I
> don't
> > get this clearly though)
>
> Mapping the objects with the corresponding locations of the image
> points.  Do you know the difference between the objects location and
> image point location?  Again, you need to understand how an image will
> be created via ray-trace.
>
> > 3. Using the location constructing splines (or 2d curves) for each
> > identified objects. and that is the vector representation of each objects
> > that we have identified.
>
> You have a set of 2D points where you have to create the 2D curves
> from (as a border of this set).
>
> > this is what I got from the project description and your mail.
> >
> > Thank You
> You're welcome,
> Daniel
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140
> ___
> BRL-CAD Developer mailing list
> brlcad-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/brlcad-devel
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


Re: [brlcad-devel] Help understanding code

2016-03-19 Thread Param Hanji
Fixed it

On Sun, Mar 20, 2016 at 6:47 AM Vasco Alexandre da Silva Costa <
vasco.co...@gmail.com> wrote:

> It doesn't compile. It seems you forgot a function declaration in a header
> file:
>
> .../brlcad/trunk/src/librt/primitives/primitive_util.c: In function
> ‘clt_solid_pack’:
> .../brlcad/trunk/src/librt/primitives/primitive_util.c:648:25: error:
> implicit declaration of function ‘clt_epa_pack’
> [-Werror=implicit-function-declaration]
>   case ID_EPA:size = clt_epa_pack(pool, stp); break;
>  ^
>
>
> On Sat, Mar 19, 2016 at 1:03 PM, Param Hanji 
> wrote:
>
>> Here's the new patch.
>>
>>
>> On Sat, Mar 19, 2016 at 6:32 PM Param Hanji 
>> wrote:
>>
>>> Oops I did manually edit the patch. I ran diff again and uploaded the
>>> patch without changes. I also changed the ID used to 19.
>>>
>>> On Sat 19 Mar, 2016, 2:51 AM Vasco Alexandre da Silva Costa, <
>>> vasco.co...@gmail.com> wrote:
>>>
 On Fri, Mar 18, 2016 at 9:14 PM, Vasco Alexandre da Silva Costa <
 vasco.co...@gmail.com> wrote:

> On Fri, Mar 18, 2016 at 1:17 PM, Param Hanji <
> param.catchch...@gmail.com> wrote:
>
>> Hello,
>>
>> On Thu, Mar 17, 2016 at 4:57 AM Vasco Alexandre da Silva Costa <
>> vasco.co...@gmail.com> wrote:
>>
>>> On Wed, Mar 16, 2016 at 9:44 PM, Param Hanji <
>>> param.catchch...@gmail.com> wrote:
>>>
>>> You will need a lot of time to port bool.c so you need to schedule
>>> appropriately. That code is rife with gotos, structs with pointers, and
>>> dynamic memory allocation. We don't want any of that in OpenCL. The 
>>> sooner
>>> you start looking into that code the better. I did some patches last 
>>> summer
>>> to remove many gotos from the existing code but there are still several
>>> left.
>>>
>>> I suggest you read the presentation Sean linked to so you can get an
>>> idea for what boolean operations and CSG are:
>>> http://web.iitd.ac.in/~hegde/cad/lecture/L30_solidmod_basics.pdf
>>>
>>> The main functions of interest in bool.c are rt_bool_eval,
>>> rt_boolweave, and rt_boolfinal. rt_boolweave and rt_bool_final do 
>>> dynamic
>>> memory allocations with linked lists but, if you read their code 
>>> carefully,
>>> the maximum output size is bounded as a function of the input size. The
>>> input is the list of intersection points. The size of the list of
>>> intersection points is already being computed by rt.cl:count_hits().
>>> So you can pre allocate a chunk of memory with the maximum possible 
>>> output
>>> size and pass that array to your functions.
>>> As for rt_bool_eval the boolean ops tree is stored as a tree of
>>> pointers to structs. Can't have that. The rt_bool_eval function uses 
>>> gotos.
>>> Can't have those either.
>>>
>>
>> I'll start looking into the code as soon as i can. Is there any
>> resource I can refer to get a brief high level understanding of how ray
>> tracing occurs. I have no knowledge of computer graphics and even
>> theoretical resources pertaining to the specific functions(eval, weave)
>> would be helpful. I'll look out for some on my own too.
>>
>
> If you want a brief idea of how the ray-tracing algorithm works you
> can look at the relevant Wikipedia page. Wikipedia is a decent resource 
> for
> basic computer graphics knowledge:
> https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29
>
> For knowing how CSG works, including the boolean ops, that lecture PDF
> is a good resource.
>
>
>> I started a patch in ANSI C to reimplement rt_bool_eval without gotos
>> with a linearized tree, stored in an array, which can be easily copied to
>> the compute device. You can find that patch here:
>> https://sourceforge.net/p/brlcad/patches/417/
>>
>>> The rt_bool_eval patch #417 is functional but it still has some
>>> warts in it.
>>>
>>>
>> I noticed that you had proposed to design a new implementation of the
>> boolean weave function in this pdf last year.
>>
>> https://drive.google.com/file/d/0B85Rkmt7rnCTZV9HNVIyZTRUMWM/view
>>
>> Was this discarded entirely? If not, does it make sense to change the
>> way weave is performed currently to facilitate easy portability to 
>> OpenCL?
>> Or should I just go about porting the existing code?
>>
>
> That PDF you linked to is from a pre-proposal which was later changed
> with output from Sean and the others. Eventually it was decided that we
> would start with a first hit ray tracer and later on work on the boolean
> evaluation proper to get working CSG. It just turns out that there was too
> much effort involved in getting the object partitioning and the rendering
> pipeline up to speed. Not to mention all those 

[brlcad-devel] (no subject)

2016-03-19 Thread Jawadh Salih Rifath
Is there any Better editor to debug the programs. CMake is not fixing from
me.

I got the error as

CMake Error at CMakeLists.txt:465 (_message):
Attempting to ignore non-existent file INTERFACE, in directory
H:/University/GSOC/2016/Sources/brlcad-7.24.0/src/other/xmltools/libxml
Call Stack (most recent call first):
misc/CMake/BRLCAD_CMakeFiles.cmake:137 (message)
CMakeLists.txt:384 (CMAKEFILES)
C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindThreads.cmake:226
(add_library)
src/other/xmltools/libxml/CMakeLists.txt:10 (FIND_PACKAGE)
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231=/4140___
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel