| 1 |
greg |
1.7 |
.\" RCSid "$Id: robjutil.1,v 1.6 2021/03/12 18:32:33 greg Exp $"
|
| 2 |
greg |
1.1 |
.TH ROBJUTIL 1 3/31/20 RADIANCE
|
| 3 |
|
|
.SH NAME
|
| 4 |
|
|
robjutil - operate on Wavefront .OBJ file
|
| 5 |
|
|
.SH SYNOPSIS
|
| 6 |
|
|
.B robjutil
|
| 7 |
|
|
[
|
| 8 |
|
|
.B +/-r
|
| 9 |
|
|
][
|
| 10 |
|
|
.B +/-v
|
| 11 |
|
|
][
|
| 12 |
|
|
.B +/-t
|
| 13 |
|
|
][
|
| 14 |
|
|
.B +/-n
|
| 15 |
|
|
][
|
| 16 |
|
|
.B "+/-m mname"
|
| 17 |
|
|
][
|
| 18 |
|
|
.B "+/-g gname"
|
| 19 |
|
|
][
|
| 20 |
|
|
.B "-c epsilon"
|
| 21 |
greg |
1.2 |
][
|
| 22 |
greg |
1.6 |
.B +T
|
| 23 |
|
|
][
|
| 24 |
greg |
1.2 |
.B "-x 'xf spec'"
|
| 25 |
greg |
1.1 |
]
|
| 26 |
|
|
[
|
| 27 |
|
|
.B input.obj ..
|
| 28 |
|
|
]
|
| 29 |
|
|
.SH DESCRIPTION
|
| 30 |
|
|
.I Robjutil
|
| 31 |
|
|
reads and manipulates a Wavefront .OBJ file, removing degenerate and
|
| 32 |
|
|
duplicate faces.
|
| 33 |
|
|
If the
|
| 34 |
|
|
.I +r
|
| 35 |
|
|
option is specified, a Radiance scene description
|
| 36 |
|
|
will be produced on the standard output.
|
| 37 |
|
|
If
|
| 38 |
|
|
.I -r
|
| 39 |
|
|
is given, a modified .OBJ file will be sent to the standard output.
|
| 40 |
greg |
1.7 |
This is the default, and is more useful for preserving
|
| 41 |
|
|
texture coordinates if directed to
|
| 42 |
|
|
.I obj2mesh(1).
|
| 43 |
greg |
1.5 |
.PP
|
| 44 |
greg |
1.1 |
The
|
| 45 |
|
|
.I +v
|
| 46 |
|
|
option turns on verbose progress reports.
|
| 47 |
|
|
.PP
|
| 48 |
|
|
The
|
| 49 |
|
|
.I \-t
|
| 50 |
|
|
option tells
|
| 51 |
|
|
.I robjutil
|
| 52 |
|
|
to remove texture coordinates from the input.
|
| 53 |
|
|
The
|
| 54 |
|
|
.I \-n
|
| 55 |
|
|
option will cause all surface normals to be removed.
|
| 56 |
|
|
.PP
|
| 57 |
|
|
The
|
| 58 |
|
|
.I "\-m mname"
|
| 59 |
|
|
option tells
|
| 60 |
|
|
.I robjutil
|
| 61 |
|
|
to remove all faces that use the material
|
| 62 |
|
|
.I mname.
|
| 63 |
|
|
Multiple
|
| 64 |
|
|
.I \-m
|
| 65 |
|
|
options may be given, each with a single (unique) material name.
|
| 66 |
|
|
Alternatively, the
|
| 67 |
|
|
.I "+m mname"
|
| 68 |
|
|
option may be used to specify a material one wishes to keep, discarding the rest.
|
| 69 |
|
|
Multiple
|
| 70 |
|
|
.I +m
|
| 71 |
|
|
options will keep all the named materials.
|
| 72 |
|
|
The
|
| 73 |
|
|
.I \-m
|
| 74 |
|
|
and
|
| 75 |
|
|
.I \+m
|
| 76 |
|
|
options are mutually exclusive.
|
| 77 |
greg |
1.5 |
.PP
|
| 78 |
greg |
1.1 |
Similarly, the
|
| 79 |
|
|
.I "\-g gname"
|
| 80 |
|
|
option says to remove all faces belonging to the group
|
| 81 |
|
|
.I gname,
|
| 82 |
|
|
and multiple
|
| 83 |
|
|
.I \-g
|
| 84 |
|
|
options may be given.
|
| 85 |
|
|
There is also a
|
| 86 |
|
|
.I +g
|
| 87 |
|
|
option to save just the named group(s).
|
| 88 |
greg |
1.5 |
Object statements are treated the same as group statements in the input, so
|
| 89 |
|
|
.I +/-g
|
| 90 |
|
|
option can also be applied to object names.
|
| 91 |
|
|
Note that an object name will be overridden by a group name that follows
|
| 92 |
|
|
it in the input, and vice versa.
|
| 93 |
greg |
1.1 |
.PP
|
| 94 |
greg |
1.3 |
The
|
| 95 |
greg |
1.1 |
.I "\-c epsilon"
|
| 96 |
greg |
1.3 |
option tells
|
| 97 |
|
|
.I robjutil
|
| 98 |
|
|
to coalesce vertices that are within the given epsilon.
|
| 99 |
greg |
1.1 |
This is useful to improve the connectivity of models that were produced
|
| 100 |
|
|
in a sloppy conversion process from independent polygons.
|
| 101 |
|
|
When producing a Radiance file via the
|
| 102 |
|
|
.I +r
|
| 103 |
|
|
option, there will be no savings in the output size, but there can be
|
| 104 |
|
|
a benefit in reducing the number of "cracks" in the resulting geometry,
|
| 105 |
|
|
at least for triangle mesh input.
|
| 106 |
|
|
.I Robjutil
|
| 107 |
|
|
does not attempt to break up non-planar polygons into triangles,
|
| 108 |
|
|
which is usually not a problem for .OBJ output, but may be for Radiance
|
| 109 |
|
|
scene descriptions (+r).
|
| 110 |
greg |
1.2 |
.PP
|
| 111 |
|
|
The
|
| 112 |
greg |
1.6 |
.I +T
|
| 113 |
|
|
option turns all faces with 4 or more sides into triangles.
|
| 114 |
|
|
.PP
|
| 115 |
|
|
The
|
| 116 |
greg |
1.2 |
.I \-x
|
| 117 |
|
|
option may be used to specify a final transform to apply to all
|
| 118 |
|
|
coordinates in the file before output.
|
| 119 |
|
|
This specification must be contained in a single quoted word and
|
| 120 |
|
|
match the standard arguments used by
|
| 121 |
|
|
.I xform(1),
|
| 122 |
|
|
except that the
|
| 123 |
|
|
.I \-a
|
| 124 |
|
|
option is not supported for creating arrays of objects.
|
| 125 |
greg |
1.3 |
Also, any scaling factors do not affect the epsilon value given for
|
| 126 |
greg |
1.2 |
coalescing vertices, as this operation is applied prior to the transform,
|
| 127 |
|
|
even if
|
| 128 |
|
|
.I \-c
|
| 129 |
|
|
appears later in the command line.
|
| 130 |
greg |
1.1 |
.SH EXAMPLES
|
| 131 |
|
|
To remove degenerate and duplicate faces from "orig.obj" and write to "final.rad":
|
| 132 |
|
|
.IP "" .2i
|
| 133 |
|
|
robjutil +r orig.obj > final.rad
|
| 134 |
|
|
.PP
|
| 135 |
|
|
To extract only the groups "cat" and "bell" from the file "kitty.obj" and
|
| 136 |
|
|
write to a Radiance triangle mesh using materials from "kitty.mat":
|
| 137 |
|
|
.IP "" .2i
|
| 138 |
|
|
robjutil +g cat +g bell kitty.obj | obj2mesh -a kitty.mat > kitty.rtm
|
| 139 |
greg |
1.2 |
.PP
|
| 140 |
|
|
To rotate the scene 90 degrees about the Y-axis and scale by 10:
|
| 141 |
|
|
.IP "" .2i
|
| 142 |
|
|
robjutil -x "-ry 90 -s 10" orig.obj > transformed.obj
|
| 143 |
greg |
1.4 |
.SH NOTES
|
| 144 |
|
|
The .OBJ output of
|
| 145 |
|
|
.I robjutil
|
| 146 |
|
|
uses relative indices, so files it produces may be concatenated
|
| 147 |
|
|
on the input of other tools such as
|
| 148 |
|
|
.I obj2rad
|
| 149 |
|
|
and
|
| 150 |
|
|
.I obj2mesh
|
| 151 |
|
|
by piping from
|
| 152 |
|
|
.I cat(1)
|
| 153 |
|
|
or similar.
|
| 154 |
|
|
This offers a convenient way to separate geometry from a single .OBJ
|
| 155 |
|
|
input, manipulate it in some way, then recombine during conversion.
|
| 156 |
|
|
.PP
|
| 157 |
|
|
Unlike
|
| 158 |
|
|
.I obj2rad
|
| 159 |
|
|
and
|
| 160 |
|
|
.I obj2mesh,
|
| 161 |
|
|
.I robjutil
|
| 162 |
|
|
with the
|
| 163 |
|
|
.I +r
|
| 164 |
|
|
option will not substitute the group name for a material id if no
|
| 165 |
|
|
.I usemtl
|
| 166 |
|
|
statements are found on the input.
|
| 167 |
|
|
Instead, it will assign each surface the material
|
| 168 |
|
|
.I DEFAULT_MATERIAL.
|
| 169 |
|
|
Since it is possible to use the
|
| 170 |
|
|
.I +/-g
|
| 171 |
|
|
option to select groups to include or exclude on output, it is
|
| 172 |
|
|
still possible to assign materials by group manually.
|
| 173 |
greg |
1.1 |
.SH AUTHOR
|
| 174 |
|
|
Greg Ward
|
| 175 |
|
|
.SH "SEE ALSO"
|
| 176 |
greg |
1.7 |
cat(1), genbox(1), gensurf(1), obj2mesh(1), obj2rad(1) oconv(1), xform(1)
|