Editing EBM

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 12: Line 12:
 
We must save this image in PNG format. In the Save dialog box we must check the 'Save with Background' option.
 
We must save this image in PNG format. In the Save dialog box we must check the 'Save with Background' option.
  
We must write down somewhere the dimensions in pixels of this image (e.g., 350x350), as this information will be needed when the ''ebm'' is created in MGED.
+
We must write down somewhere the dimensions in pixels of this image. (e.g., 350x350)
  
 
[[Image:Ychar.png|GIMP image of the Y char]]
 
[[Image:Ychar.png|GIMP image of the Y char]]
Line 27: Line 27:
  
 
===Inserting ''ebm'' in MGED===
 
===Inserting ''ebm'' in MGED===
  mged> in text1.s ebm f image_name.bw 350 350 20
+
  mged> in text1.s ebm image_name.bw 350 350 20
  
If we don't type the dimensions (in pixels) of the file ''image_name.png'' exactly as it was created, the ''ebm'' shape that we get will not be the desired result.
+
If we don't type the dimensions (in pixels) of the file ''image_name.png'' exactly as it was created, the ''ebm'' shape that we get will not be good.
  
 
[[Image:Ychar_ebm_Wireframe.jpg|the wireframe of the inserted ebm]]
 
[[Image:Ychar_ebm_Wireframe.jpg|the wireframe of the inserted ebm]]
Line 38: Line 38:
  
 
[[Image:Ychar_ebm_Raytraced.jpg|raytraced region of the ebm]]
 
[[Image:Ychar_ebm_Raytraced.jpg|raytraced region of the ebm]]
 
===Creating ''ebm'' with database objects===
 
An alternative method to create an ''ebm'' is to use a binary database object, which can store a .bw file's data, rather than directly use a .bw file as the data source. While the results will be the same, the advantage of this approach is that the ''ebm'' does not need to rely on an external file, meaning that it will still function even without the presence of the original .bw file. This can be done through the following steps:
 
 
 
The first step is to actually create the binary database object that will store the .bw file data. This can be done through the "bo" command.
 
 
mged> bo -i u C dbobj image_name.bw
 
 
This uses the contents of the file "image_name.bw" to create a binary database object of unsigned characters called "dbobj." Note that "C" is used to denote the unsigned char type, as this is what ''ebm'' reads.
 
 
 
Creating an ''ebm'' using the binary database object as the data source is similar to before, with a few exceptions.
 
 
mged> in text2.s ebm o dbobj 350 350 20
 
 
In this case, there is an "o" indicating an object source instead of an "f", and the name of the source is now the name of the binary database object rather than the name of a file.
 
 
Once the ''ebm'' has been created, the original .bw file can be removed as its data will still be stored internally within the binary database object.
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)
Retrieved from "https://brlcad.org/wiki/EBM"