Write up Wiki page tutorial on our Volumetric PrimitiveBRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags:

BRL-CAD provides a couple dozen distinct primitives. Each primitive is defined by a set of parameters. Several of the more complex primitives have a wiki page describing them in more detail with an example on how to create them.

This task involves writing up a page on the VOL primitive. Figure out how to use it (see the ''in'' command, see the EBM tutorial, etc), create an example input data set, and write up a wiki page on exactly what steps are needed similar to our other wiki pages:

References:

  • http://brlcad.org/wiki/DSP
  • http://brlcad.org/wiki/Sketch
  • http://brlcad.org/wiki/EBM (particularly useful as the data is similar for VOL)

Show how to create a VOL with at least two layers/slices. Include images like the other examples. Put the write-up at http://brlcad.org/wiki/VOL

Uploaded Work
File name/URLFile sizeDate submitted
VOL primitive.docx12.4 KBDecember 21 2013 15:39 UTC
Comments
Pulkit Mehtaon November 20 2013 13:18 UTCTask Claimed

I would like to work on this task.

Pulkit Mehtaon November 20 2013 13:20 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

Pulkit Mehtaon November 20 2013 13:21 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on November 20 2013 13:30 UTCTask Assigned

This task has been assigned to Pulkit Mehta. You have 72 hours to complete this task, good luck!

Pulkit Mehtaon November 20 2013 13:35 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

Alexon November 22 2013 17:13 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on November 22 2013 17:14 UTCTask Assigned

This task has been assigned to Alex. You have 72 hours to complete this task, good luck!

Alexon November 22 2013 17:48 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

Alexon November 23 2013 11:48 UTCthe VOL?

how can i find out what the VOL primitive is? and how to use it? 

Jade Kankamon December 15 2013 17:16 UTCTask Claimed

I would like to work on this task.

Jade Kankamon December 15 2013 17:16 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

Alexon December 18 2013 15:45 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on December 18 2013 15:47 UTCTask Assigned

This task has been assigned to Alex. You have 72 hours to complete this task, good luck!

Alexon December 18 2013 23:46 UTCin command parameters?

I have been testing the 'in command' and looking at various other pages trying to understand the vol primitive but i have a few questions about the parameters.


What is the upper and lower threshold?


When creating the file to be reffered to in the 'in command' for the vol primitive do i make it a '.txt' file and enter the 3  dimensions (x,y,z) on the same line (3,4,5) or do each number seperately?


and when it asks for the cell dimensions and the file dimensions are they the same thing?

Alexon December 21 2013 00:16 UTCin command?

I am having trouble with the in command, it seems no matter what numeric values i enter for xyz are correct and an error is always returned.


I must have the wrong idea.


currently i have a .txt file which has one line state '30, 20, 50' (the xyz dimensions).


i have that file in the brlcad folder and reffer to it when using the in command, the in command will then ask for the xyz dimension of the file and i enter the dimensions above (from the file). i then go on to enter the cell dimensions and the thresholds and an error is always returned. i have tried using the ebm tutorial for comparison but havent really got anywhere. 


Also for some reason no matter what error does come up, at the bottom their is always this import error 'rt_db' import failure which will seem to come up.


could i please have some advice/help on my problem(s)?

Alexon December 21 2013 00:18 UTC.s file?

also what is the .s file in the ebm tutorial it is not explained? should i be creating an s file with the dimensions?

Alexon December 21 2013 15:40 UTCempty uploaded file

I know the file uploaded was empty but i did this to hopefully have some more time on the task with a reply to queries?

Alexon December 21 2013 15:40 UTCReady for review

The work on this task is ready to be reviewed.

Melange on December 21 2013 15:47 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on December 22 2013 05:41 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Sean on December 22 2013 05:41 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 22 2013 05:47 UTCrange where it's solid

Each "cell" in a vol has a value that is somewhere between 0 and 255 inclusive (i.e., a grayscale value).You can define a range of value to imply that the cell is ON (i.e., solid) or OFF (i.e., empty).  For example, if you set the range to 1-255, then any non-zero value will result in geometry there.  In practice, you'd often want to set something like 127-255 so that cells that are more than half-intensity become geometry.


You definitely do not create a text file.  You can start with that, but vol knows nothing about text files.  It wants a bw image.


I suggest first start by going through the EBM overview on the wiki, make sure you can successfully create one, and understand the basic gist of the steps.  The VOL is nearly identical.


 

Alexon December 24 2013 00:59 UTCerros

Thanks for you response i have been going through the EBM tutorial and comparing but i am still having difficulties with getting the vol primitive to function. As you said i should be using a 'bw' (bitmap) image i used the one from the EBM tutorial to try and when it asked for the xyz dimensions as 350, 350, 20. (the dimensions from the ebm tutorial), i then tried the lower threshold value and upper threshold value as l:127 and U:255


I tried cell dimensions of 0.5 0.5 0.5


errors where still being returned


should i be using a different type of bitmap image?


How do i know the xyz dimensions of the image?


What determines the cell dimensions?

Alexon December 24 2013 00:59 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 24 2013 04:29 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Sean on December 24 2013 04:36 UTCsuccessfully understood?

Alex, you said you went through the EBM tutorial, but did you complete it?  Moreover, if you completed it correctly and rendered an EBM, did you understand all of the steps and inputs you provided? 


I ask because you will not be able to just copy parameters verbatim from the EBM.  It's an example that is only useful if you understand all of those numbers.  For example, what does 350, 350, 20 mean?  An image is LENGTHxWIDTH so what does that third value mean?  If it specifies a height, that will not be the same for a VOL because it's a different structure.


A VOL is only *similar* to an EBM, not identical (otherwise, what would be the point, amiright?).  You can sort of think of a vol as a bunch of EBMs stacked one on top of each other.  It'll still need to know the dimensions of one layer, but it also needs to know how many layers.  If you use just one BW image, you only have *1* layer, so somewhere where you specify the layer count or a "data height" etc.


That's why the point of the EBM tutorial is only to understand the commands, not to use those values.  You asked how you know the dimensions of an image ... well create one!  Then you will certainly know. ;)


 

Sean on December 24 2013 04:39 UTCin brief

That was a lot of questions, so here's something simple for you to try.  Create a 256x256 image with a gradient or some shape drawn into the image.  Save it as a png.  Run png-bw to create a bw file.  Successfully create an EBM using that bw file.


If you fail at creating the EBM, it's time to stop and revisit the EBM tutorial and/or ask a specific question.


If you're successful, next try creating a vol, now knowing that you have a simple 256x256 image to work with.  It's exactly 1 layer.  Run the "in" command with only three arguments: in myobject vol


It should interactively prompt you for the rest.


 

Sean on December 24 2013 04:39 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Alexon December 26 2013 02:19 UTCEbm understood

from your previous reply i do understand and have successfully used the ebm primitive from the tutorial. I follow what you said and entered in myobject vol and let it prompt me for the rest. The vol primitive asks for the xyz dimensions i tried entering 256 256 1


(256 x 256) from the picture i created as you recommended(presumably the height and width of the image i created would be x and y )


(1) representing one layer (for z) - wasnt entirely sure on that


i entered 127 255 as the lower and upper thresholds (i understand what thhey are)


the xyz cell dimensions i entered were 2 2 2         ?


once i entered all of this i recieved a bad pointer error instead of the usual db recurse error.


where am i going wrong ? i understand what the prompts are but am not entirely certain on what to enter.


i apologize for taking so long to grasp this.

Alexon December 26 2013 02:19 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 26 2013 04:15 UTCsources up to date?

Is your source checkout up to date?  There was a problem with vol objects thinking they were ebm objects and causing a bad pointer error but that was supposedly fixed a couple weeks ago.  The steps you ran sound right.  If you're using up-to-date sources, have a fresh compile, are still getting that error, and we confirm it, you will be able to claim a separate task for finding a bug and we can then return to this one.


 

Sean on December 26 2013 04:15 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 26 2013 04:15 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Alexon December 28 2013 02:26 UTCmore time ?

please could i have some more time?

Alexon December 28 2013 02:26 UTCReady for review

The work on this task is ready to be reviewed.

Melange on December 28 2013 06:11 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on December 28 2013 06:12 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Sean on December 28 2013 06:13 UTCstatus

Alex, I fear that you're fighting too many issues at once.  We don't want you to struggle endlessly on this (or any task) unless you're having fun. ;)


Did you confirm that your sources were up to date?  If they are and/or you're encountering a bug, please let us know.  That's justification to claim a bug-report task.


 

Sean on December 28 2013 06:13 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Alexon December 29 2013 00:02 UTCsources updated

on the brlcad disk image i have i navigated to the 'brlcad-svn-trunk' folder and entered svn up, once it was updated i entered the commands from the compiling page and made the .build folder and then entered 'make'.


After this i opened mged and typed in the same parameters as before (except with a new name of the object). 


(in myobject2 vol testimg.bw 256 256 1 127 255 2 2 2)


and got this same bad pointer error:


ERROR: bad pointer 0xa04adc0: s/b rt_ebm_internal(xf901b231), was rt_vol_internal (x987ba1d0), file /home/brlcad/brlcad-svn-trunk/src/librt/primitives/vol/vol.c, line 761


 

Alexon December 29 2013 00:15 UTCenjoying

Oh and i am enjoying these open source projects, even though i usually have difficulties in the tasks i am learning alot about open source, how it functions and how people co-operate. I am also learning more about 3D modeling which is an area i didnt know much about before starting BRL-CAD tasks.

Alexon December 29 2013 23:27 UTCReady for review

The work on this task is ready to be reviewed.

Jacob Burroughson December 30 2013 00:07 UTCFile Format

Alex,You should upload this as an rtf, odt, or some other open file format.  Not every developer has access to MS Word, and that file does not open right in LibreOffice.

Sean on December 30 2013 04:43 UTCbad pointer

Alex, that file:line number indicate something is amiss.  Either "svn up" is failing to complete or you're somehow running an old mged.  Try running "svn info ." and "svn info src/librt/primitives/vol/vol.c" 


Here's what the output should look like:


sushi:brlcad.trunk morrison$ svn info .
Path: .
URL: svn+ssh://brlcad@svn.code.sf.net/p/brlcad/code/brlcad/trunk
Repository Root: svn+ssh://brlcad@svn.code.sf.net/p/brlcad/code
Repository UUID: 2f96ce8b-6d43-0410-b8df-bffccc660ffb
Revision: 59226
Node Kind: directory
Schedule: normal
Last Changed Author: tbrowder2
Last Changed Rev: 59226
Last Changed Date: 2013-12-29 06:33:02 -0500 (Sun, 29 Dec 2013)

sushi:brlcad.trunk morrison$ svn info src/librt/primitives/vol/vol.c
Path: src/librt/primitives/vol/vol.c
Name: vol.c
URL: svn+ssh://brlcad@svn.code.sf.net/p/brlcad/code/brlcad/trunk/src/librt/primitives/vol/vol.c
Repository Root: svn+ssh://brlcad@svn.code.sf.net/p/brlcad/code
Repository UUID: 2f96ce8b-6d43-0410-b8df-bffccc660ffb
Revision: 59226
Node Kind: file
Schedule: normal
Last Changed Author: n_reed
Last Changed Rev: 59208
Last Changed Date: 2013-12-27 18:53:52 -0500 (Fri, 27 Dec 2013)
Text Last Updated: 2013-12-28 12:11:57 -0500 (Sat, 28 Dec 2013)
Checksum: 59795561b86533932e818511ad3a794e

re>

Assuming you do match that, run "which mged" to make sure you're running the mged that you compiled. It should be the .build/bin/mged binary.

Sean on December 30 2013 04:43 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 30 2013 04:43 UTCDeadline extended

The deadline of the task has been extended with 1 days and 0 hours.

Alexon December 31 2013 03:04 UTCresults differ

i entered in the command you said and found the data displayed was different.


from the brlcad-svn-trunk directory on the command line i entered svn info:Path: .


URL: svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk


Repository Root: svn://svn.code.sf.net/p/brlcad/code


Repository UUID: 2f96ce8b-6d43-0410-b8df-bffccc660ffb


Revision: 59237


Node Kind: directory


Schedule: normal


Last Changed Author: agkphysics


Last Changed Rev: 59237


Last Changed Date: 2013-12-30 18:37:50 -0600 (Mon, 30 Dec 2013)


 


 


when i entered this was displayed: svn info src/librt/primitives/vol/vol.c


Path: src/librt/primitives/vol/vol.c


Name: vol.c


URL: svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk/src/librt/primitives/vol/vol.c


Repository Root: svn://svn.code.sf.net/p/brlcad/code


Repository UUID: 2f96ce8b-6d43-0410-b8df-bffccc660ffb


Revision: 59237


Node Kind: file


Schedule: normal


Last Changed Author: n_reed


Last Changed Rev: 59208


Last Changed Date: 2013-12-27 17:53:52 -0600 (Fri, 27 Dec 2013)


Text Last Updated: 2013-12-27 19:02:45 -0600 (Fri, 27 Dec 2013)


Checksum: 59795561b86533932e818511ad3a794e


 

 

and i entered 'which mged' this was displayed :

 

/usr/brlcad/dev-7.24.1/bin/mged

Alexon December 31 2013 03:06 UTCfile format

Oh and i will make sure to upload one of the file formats from what was mentioned when i manage to create the page on the primitive.

Alexon December 31 2013 03:07 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 31 2013 05:29 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 31 2013 05:36 UTCclosing this task out

Alex, I'm closing this task out due to the complications.  From your log, the only explanation that makes sense is that you are recompiling but perhaps not installing the updated mged.  If you'd like to continue the effort, we can reopen a new task, or you can move on to something else.  Your choice.  E-mail devs@brlcad.org if you'd like to continue.

Alexon January 4 2014 17:22 UTCapologies

Ok im sorry for not being able to complete the task