[Radiance-general] import from other software

Thomas Bleicher tbleicher at googlemail.com
Sat May 1 00:57:33 PDT 2010


Jia.

I don't have any experience with a Revit based process. Below are just
a few general remarks to obj2rad (and CAD import in general).

On Sat, May 1, 2010 at 2:49 AM, Jia Hu <hujia06 at gmail.com> wrote:

> (1) When I export Revit to fbx and then use FBX converter (provided by
> autodesk) to convert fbx to .obj file.  The .mtl file just contains the name
> of materials without any other data such as RGB, or reflectance.

That is not necessarily a bad thing. The RGB values would almost
certainly be based on screen RGB values which have to be converted for
Radiance. It's better to define a set of materials for Radiance and
assign colors/materials with the same name in your CAD application.
After you have converted the geometry (material data not necessary)
you add your Radiance materials file to the scene and all polygons
will pick up the assigned materials with correct definition.

> Also I tried to use: obj2rad -n objfile.obj > obj.data . I found all the
> materials in .obj file should be defined. Some of  them are as follows:
>
> "Basic_Wall_Typ__Partition_Wall__188653_"
> "Basic_Wall_Typ__Partition_Wall__188781_"
> "Basic_Wall_Typ__Partition_Wall__188881_"
> "Basic_Wall_Typ__Partition_Wall__188971_"
> "Basic_Wall_Typ__Partition_Wall__189016_"
> ...... too long
>
> Should I define so many materials? Maybe I should delete some of them if
> they use the same materials.

The idea of the -n option is to give you an understanding of the
objfile structure. You can use the output to define a mapping file
which, for example, assigns a new material to each group in the file.
If there are any useful groups or objects in the file depends on the
way the converter works.

> (2) I am stuck with the command obj2rad. I just know some basic knowledge of
> .obj file such as its basic structure, the basic command of obj file. But  I
> can not follow the man page of obj2rad, such as mapping rule file.
>
> Is that right the mapping rule file in this command contained the texture
> and materials (like those in Radiance) or some images?

No. The mapping file contains rules that define something along the lines of:

"for any face in the group 'tree' that has the texture 'bark' use the
Radiance material 'brown'"

There is no definition of the material 'brown'. You have to provide
that only when you compile your octree at a later stage.

The above rule in the mapfile would look like:

brown (Group "tree") (Map "bark") ;

You can find out which objects and groups are used in the objfile with
the -n option.

> Should I write up the mapping file by myself or just find from
> somewhere? I have no idea of what the mapping file is so, Could
> someone send me one or two small examples of map files or
> others related to this command?

You have to write the map file yourself because it depends on the
definitions in your obj file. If the man page and the above example
are not clear enough you can export the geometry into different obj
files based on their material (all "wall" polygons go in one file, all
"floor" polygons in another). Then you use a single line with the
material name you wish to use for each object. So the mapping file
"floor.map" contains only the line

floor ;

and would be use in the obj2rad command:

obj2rad -m floor.map floor.obj > floor.rad

> (3) When the building model is complicated, is that reliable for this
> command? I mean whether it makes mistakes about the surface normals. Is
> there any point that should be noted when using export Revit file to
> Radiance?

Radiance does not care about the surface normals. The obj file can
only contain 3- and 4-vertex polygons which Radiance can handle. If
Revit produces surface normals for all polygons and you have only flat
objects you can use the "-f" option of obj2rad to ignore this
information. This will make your *.rad file much smaller.

Caveat: Yesterday I tried to import a *.obj file created by 3D Max.
The file was not a valid file and obj2rad (or rather obj2mesh in my
case) stopped with an error. This is obviously not the fault of
obj2rad but the usability of this work flow depends on the quality of
the *.obj files you can create.

> (4) If I export .dwg, the torad autolisp
> (http://www.schorsch.com/download/torad/) seems to be used for AutoCAD
> R11-14. If I use Polytrans, for example, should I convert obj file? Is there
> any better way?

George also has a stand alone application available for download:

http://www.schorsch.com/download/dxf2rad/

I'm not sure about the Linux version with all the glib versions out
there but the Windows version should still run on a typical Windows
machine.

> (5) I do not have a SketchUp pro, so I just browsed the su2rad for free
> version of SketchUp, it seems easy to understand.

Wow. Easier than obj2rad, eh? Please note that su2rad will also covert
your RGB colors to the Radiance RGB values. You can use your existing
Radiance materials if you want, though.

Regards,
Thomas



More information about the Radiance-general mailing list