Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-11 Thread Mario Meissner
My last two emails (of today and yesterday) got accidentally sent only to myself (I probably pressed reply to an email from myself and it somehow didn't get sent to the mailing list). I will now re-send them to the mailing list. Sorry for this. Mario. 2017-08-09 23:04 GMT+02:00 Mario Meissner :

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-09 Thread Mario Meissner
Hi Sean! Thank you a lot for the details. The visualization of Voronoi points was really helpful. I think I understand your vision and will work on implementing the first steps as soon as the stuff I mention below is done. I'm running into some trouble with my code. I need to call readDensityValu

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-08 Thread Christopher Sean Morrison
> Fair enough. My next goal will be to make our initial minimal feature > working. In this case this means having a way to let the user define points > that will be used for query_density(), instead of hardcoding them. I guess > for now I will use the .density file as I have no idea how the who

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-08 Thread Mario Meissner
Hey Sean! Glad to hear back from you! Hope your trip went fine. Tons of new information! Let me try to dig through it. Both this prior version and the latest viewweight.c suffer from the comment > I originally made, namely that the 0 and 1 point cases are not what i would > call “complete". That’

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-07 Thread Christopher Sean Morrison
> If I were to initialize my vectorlist before we start shooting rays, and > leave it prepared so that each call of hit() is able to access this list, > where and how should I do it? It depends. If we’re talking about the material objects concept, they would auto-load during database traversal

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-07 Thread Christopher Sean Morrison
> On Aug 4, 2017, at 4:36 PM, Mario Meissner wrote: > > Is there a new version of the code demonstrating them working? > > Yes, it is attached to today's email. It should compile and produce an > rtexample binary that runs the example I set up correctly. Both this prior version and the lates

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-07 Thread Christopher Sean Morrison
> I also now added a curve to the blade by intersecting it with a stretched out > sphere. I considered various options but this one ended up being my favorite. A variation of this is what I had in mind possibly working for the curved taper and curve of the blade. Instead of ellipsoids, somethi

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-07 Thread Mario Meissner
I would also like to get some more info about how you mentioned we could model those complex examples I sent. You said something about half-spaces...How would it work exactly? 2017-08-07 14:47 GMT+02:00 Mario Meissner : > Hi again! > > A few questions: > >- If I were to initialize my vectorli

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-07 Thread Mario Meissner
Hi again! A few questions: - If I were to initialize my vectorlist before we start shooting rays, and leave it prepared so that each call of hit() is able to access this list, where and how should I do it? - Might it be that the ray-shoots happen inside some loop in worker.c? If n

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-06 Thread Mario Meissner
Followup, As promised, I checked whether or not points outside of geometry behave like expected, and so they do. I did the following to test it: Reduced the box to half its width, so that we now only use half of the 5->10 vector. Now the box starts with 5 and ends with 7.5 on the other edge. It a

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-05 Thread Mario Meissner
Hello again! I moved my code over to viewweight.c. For now I just put my density() function alongside the other functions inside the file, and my own structures below the already defined ones. Other than that I just needed to add some lines to the end of the hit() function to use my density() cal

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-04 Thread Mario Meissner
Is there a new version of the code demonstrating them working? Yes, it is attached to today's email. It should compile and produce an rtexample binary that runs the example I set up correctly. There are a variety of cases with 2points that should also be explored and ensure are being handled too

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-04 Thread Christopher Sean Morrison
> A few days back I commented out some code to make a simplex example work. Now > I brought the changes back in. The same example now works on the full version > as well. Is there a new version of the code demonstrating them working? The last snippet I saw yesterday didn't look complete. Sp

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-04 Thread Mario Meissner
Hey Sean! Hope you're enjoying your trip! A few days back I commented out some code to make a simplex example work. Now I brought the changes back in. The same example now works on the full version as well. My next goal will be to set up a better test case with 4 points. I also am moving over to

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-08-03 Thread Mario Meissner
Hi! I also now added a curve to the blade by intersecting it with a stretched out sphere. I considered various options but this one ended up being my favorite. Am not sure why the resolution of the sphere is so low, I can see the polygons if I render it. Can I change that? I'm guessing you're on a

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-30 Thread Christopher Sean Morrison
> On Jul 30, 2017, at 12:25 PM, Mario Meissner wrote: > > Hi again! > > Attached goes current state of my new function. I've not even tried to run it > yet as I still need to work on it before expecting anything to work. I encourage you to approach this from a somewhat different development

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-30 Thread Mario Meissner
Hi again! Attached goes current state of my new function. I've not even tried to run it yet as I still need to work on it before expecting anything to work. However, I would love to know if this is even remotely heading towards the right direction. Inside the code are some questions commented out

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-30 Thread Mario Meissner
> > After it’s working, that’s the next logical step. Don’t want to > scope-creep the complexity prematurely, but we will eventually want > material objects defining the density (and other) material characteristics > of an object (as a replacement for .density files and _DENSITY objects). > Sure.

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-29 Thread Christopher Sean Morrison
> > Probably a good time to revisit the big picture now that there’s more > familiarity with terminology: > http://brlcad.org/wiki/Density_functions > > http://brlcad.org/wiki/Material_and_Shader_Objects >

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-29 Thread Mario Meissner
> > I think you’re right on track. Your stubs in the code ( *_FACTOR and > MAT_DENSITY) naturally lend themselves to substitution with a function, and > implementing those functions figuring that out from your density_point > structure next would be a good progression. I’d suggest starting with 0

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-28 Thread Christopher Sean Morrison
> I fixed the issues I mentioned and the snippet now works as intended. Just > compile and run rtexample to check it out. > I'll continue with the next snipped I proposed unless you think I should do > something else instead :P I think you’re right on track. Your stubs in the code ( *_FACTOR

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-28 Thread Mario Meissner
Hi again. I fixed the issues I mentioned and the snippet now works as intended. Just compile and run rtexample to check it out. I'll continue with the next snipped I proposed unless you think I should do something else instead :P Mario. 2017-07-27 22:42 GMT+02:00 Mario Meissner : > This is gr

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Mario Meissner
> > This is great, please keep sharing. This looks potentially like the > beginnings for what a proper material object (see TODO) might end up > requiring/using for the typein interface. > Which TODO do you mean? > Some feedback, you should use bu_fgets for portability. You're also also > not

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Christopher Sean Morrison
> > That's fair enough. I was afraid that if we might carry on without > considering it, we might not be able to easily include it to existing code > afterwards. But if it's viable to defer it, so we shall do. No easier or harder, definitely viable. More overriding is an old adage by Alan Kay

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Mario Meissner
Hi Sean! It's an extension that can be made after vectors are working. Basically > instead of treating them as vectors, you'll need to treat the as half space > plane definition. Calculating the density at any point will be the > contribution of any given set of points, and knowing which ones wi

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Christopher Sean Morrison
> On Jul 27, 2017, at 6:29 AM, Mario Meissner wrote: > > Sean, > > To continue with the vector discussion: > Now that I understand how you propose to handle the vectors, let me ask you, > how would you model the examples I proposed, that I thought were impossible > to model using our vector

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Christopher Sean Morrison
> How does hypersampling work, and what does the variable hypersample exactly > contain? It is the number of samples per grid cell, holding the value of the -H command line option. If you run "brlman rtweight" you can read more on what that and other options do. > The region struct seems to h

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-27 Thread Mario Meissner
Sean, To continue with the vector discussion: Now that I understand how you propose to handle the vectors, let me ask you, how would you model the examples I proposed, that I thought were impossible to model using our vectors? Using your method did not help me find a solution to them either, so I

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-26 Thread Mario Meissner
It was, indeed, just a problem of printing. Numbers are big so it didn't fit in %d. I used %lld now and I got acceptable results. After looking a bit over viewweight again, there are two concepts that I would like to know more about. How does hypersampling work, and what does the variable hypersa

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-26 Thread Christopher Sean Morrison
> On Jul 26, 2017, at 10:59 AM, Mario Meissner wrote: > > Sean, > > Today I started modifying rtexample.c so that it simulates a ray crossing > several regions (tried with the goblet example) and returning the mass it saw > as it crossed each region. I assumed most stuff with predefined cons

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-26 Thread Mario Meissner
Sean, Today I started modifying rtexample.c so that it simulates a ray crossing several regions (tried with the goblet example) and returning the mass it saw as it crossed each region. I assumed most stuff with predefined constant values for now. Most changes happened at lines 115 and 179. Next

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-26 Thread Christopher Sean Morrison
> I think I can follow you, but I'm not sure how to put contributions together. > In the blade example you seem to be taking the mean value between them. I'll > assume that's the case. > Attached goes a simple box with two vectors. Should the density at point a be > 5? Let’s see. The gist of

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-26 Thread Mario Meissner
> This is flawed for one simple reason — material properties do not > multiply. At least, not for any common materials I can think of that we > care about. > The problem lies in the definition I gave to the vectors. I tried to use them like follows: If we have a vector that goes to the right with

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-25 Thread Christopher Sean Morrison
> On Jul 19, 2017, at 7:04 AM, Mario Meissner wrote: > > We probably have some different ideas on how it should work, because of your > "the largest value should be 3*V=9". I thought that if we have a horizontal > vector going right, and a vertical vector going down, and we take the > diagona

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-21 Thread Mario Meissner
Hello again. Another situation that bothers me is also attached hereby. If we set both a vertical and a horizontal vector and take the diagonal, we are forced to predefined values by those vectors. But that if I want the diagonal to be something else instead of what the horizontal and vertical vec

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-19 Thread Mario Meissner
Sorry my last email got sent accidentally while I was writing (pressed some weird hotkey). This is complete version: We probably have some different ideas on how it should work, because of your "the largest value should be 3*V=9". I thought that if we have a horizontal vector going right, and a ve

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-19 Thread Mario Meissner
We probably have some different ideas on how it should work, because of your "the largest value should be 3*V=9". I thought that if we have a horizontal vector going right, and a vertical vector going down, and we take the diagonal that goes the full distance down and right (so basically a 2D squar

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-18 Thread Christopher Sean Morrison
> Attached goes an example of one way I think it might work. This is an excellent example to work through! > In the end we want one vector for each axis, that tells, through a > multiplier, how the density changes as we move in its direction. Choosing any > point in the region is taking the ri

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-18 Thread Christopher Sean Morrison
> On Jul 18, 2017, at 6:01 AM, Mario Meissner wrote: > > Hereby goes blade with a box (arb8) on top, intersected with with an arb6 > that narrows towards the tip, and another arb6 added below and also > intersected with the other arb6, that makes the bottom of the blade sharp. If > we now als

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-18 Thread Mario Meissner
Hereby goes blade with a box (arb8) on top, intersected with with an arb6 that narrows towards the tip, and another arb6 added below and also intersected with the other arb6, that makes the bottom of the blade sharp. If we now also manage to model that curve, it should look pretty similar to the Di

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-18 Thread Mario Meissner
Sean, thank you for the extensive explanation, and sorry for the misunderstanding. When you said that "instead of considering the ray line lets consider segments" I thought that these segments were something else not related to the rays. Let me attempt to summarize everything into a bullet-list, se

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-17 Thread Christopher Sean Morrison
> On Jul 17, 2017, at 4:24 PM, Mario Meissner wrote: > > Okay, so let's make sure I understand the current code before continuing with > the new specifications. > > About the blade, yes I tried to just mix both because that made it simpler. > > Tomorrow I'll make the new blade (without the

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-17 Thread Mario Meissner
Okay, so let's make sure I understand the current code before continuing with the new specifications. About the blade, yes I tried to just mix both because that made it simpler. Tomorrow I'll make the new blade (without the curve) and get going with the code. It seems like I'm missing some basic

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-17 Thread Christopher Sean Morrison
> On Jul 17, 2017, at 2:42 PM, Mario Meissner wrote: > > It took me way longer than it should have and I don't know how to round up > the edges but here goes an initial rough model of the blade using two arb6 > primitives. Looks like you tried features of both blade types, but that results in

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-17 Thread Mario Meissner
It took me way longer than it should have and I don't know how to round up the edges but here goes an initial rough model of the blade using two arb6 primitives. 2017-07-17 16:37 GMT+02:00 Mario Meissner : > Hello Sean. > > In the general case, we do not necessarily know the “shape" of the >> geo

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-17 Thread Mario Meissner
Hello Sean. In the general case, we do not necessarily know the “shape" of the > geometry, particularly having an equation for the geometry to substitute in > a line equation like in your case. For example, the sword blade case might > be constructed as a union of several objects, like if you mod

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-16 Thread Christopher Sean Morrison
> On Jul 15, 2017, at 4:00 PM, Mario Meissner wrote: > > Hi Sean. > > • You are right, given the endless possibilities of a function like > this, it may not be obvious to define the function in the file as I > mentioned. Some re-considerations would need to be made in order to support

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-15 Thread Mario Meissner
Hi Sean. - You are right, given the endless possibilities of a function like this, it may not be obvious to define the function in the file as I mentioned. Some re-considerations would need to be made in order to support any number of arguments, any polynomial degree. Who knows, maybe

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-14 Thread Christopher Sean Morrison
> I believe that users could input the density properties of the material into > the properties file by writing the coefficients of the function in some > predefined way. For example, the function I used in my example could be an > entry in the file like this: 3; 2; 3; -5 But what function a

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-14 Thread Mario Meissner
Sean, this was exactly what I was looking for. Will study through it. I'll get back to you hopefully tomorrow with thoughts on this documentation. To your questions in our last email: - I believe that users could input the density properties of the material into the properties file by writin

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-14 Thread Christopher Sean Morrison
> On Jul 13, 2017, at 10:45 AM, Mario Meissner wrote: > [snip] > However, as I do not yet understand how rtweight currently behaves, I do not > know if this model is viable and what other considerations one needs to make. I suggest reading through these links (from bottom to top) and studying t

Re: [brlcad-devel] Example of heterogeneous density + mass calculation

2017-07-13 Thread Daniel Roßberg
Hi Mario, Well, the rt in rtweight comes from ray-trace. I.e., this program shoots a series of rays at the model. The hit() function in src/rt/viewweight.c determines what shall be done when one of these rays hits a region. First, it determines the length of the ray inside the region (line 133)