You are on page 1of 18

Translators

Translators and Slicing Utilities


Version 12.1 for Windows
© 1996-2012 InnovMetric Software Inc. All rights reserved.

This manual, as well as the software described in it, is furnished under license and may be
used or copied only in accordance with the terms of such license. The content of this
document is furnished for informational use only, and is subject to change without notice.
InnovMetric Software Inc. assumes no responsibility or liability for any errors or inaccuracies
that may appear in this document.

Except as permitted by such license, reproduction in whole or in part in any way without
written permission from InnovMetric Software is strictly prohibited.
Contents

4 Introduction
4 Contents of the Translators Reference Guide
4 Related documentation
5 Technical support

6 1. Polygonal Translators
7 1.1 Information extracted from polygonal files
8 1.2 Controlling the DXF translator
8 1.3 Controlling the IGES translator
9 1.4 Controlling the STL translator
10 1.5 Controlling the VRML translator
10 1.6 Hints

11 2. Image Translators
12 2.1 Image translation strategy
12 2.2 Hints

13 3. IMConvert and IMSlice


14 3.1 A general call to IMConvert
15 3.2 Basic parameters
15 3.2.1 Specifying an input model file
15 3.2.2 Translating an input model file to another format
16 3.2.3 Scaling a polygonal model
16 3.2.4 Applying a transformation matrix to a polygonal model
16 3.2.5 Getting feedback
17 3.3 Slicing a polygonal model using IMConvert and IMSlice
17 3.3.1 Specifying a starting point for the slicing algorithm
17 3.3.2 Automatically closing small gaps in the polygonal model
17 3.3.3 Slicing along an arbitrary axis
18 3.3.4 Using IMSlice to produce three sets of orthogonal slices
18 3.4 Saving a polygonal model to a point cloud file

Translators Reference Guide V12.1 3


Introduction

This document provides useful information about the PolyWorks polygonal and image
translators. It also describes IMConvert and IMSlice, command line tools; the first
translates files from one polygonal format to another, and the second slices polygonal
models.

This Translators Reference Guide may be used in conjunction with a version 12.1 or later
release of the following InnovMetric Software products: IMAlign™, IMMerge™, IMEdit™,
IMCompress™, IMTexture™, IMInspect™, IMSurvey™, and IMView™.

Contents of the Translators Reference Guide

This guide contains three chapters:

1. Polygonal Translators
This chapter describes the polygonal translation strategy provided by InnovMetric
Software’s products. Features specific to particular formats are also presented.

2. Image Translators
This chapter describes InnovMetric Software’s image translators.

3. IMConvert and IMSlice


This chapter shows how to use IMConvert and IMSlice for polygonal format conversion
and slicing.

Related documentation

The following documents offered in PDF format, available from the Help > Reference
Guides menu of the PolyWorks/Workspace Manager, offer related information:

 The PolyWorks® Reference Guide presents the PolyWorks software suite, including the
PolyWorks/Workspace Manager, and explains how to customize the user interface by
means of visual layouts. It also explains how to invoke modules from the PolyWorks/
Workspace Manager. Finally, appendixes describe the installation procedure for both
node-locked and floating licenses.

Translators Reference Guide V12.1 4


Introduction

All reference documentation can be accessed from the PolyWorks/Workspace Manager.


See its Help > Reference Guides submenu.

Technical support

Report any problems, or send your suggestions, directly to InnovMetric Software at


www.innovmetric.com. The InnovMetric Software technical support team can also be
contacted by e-mail at support@innovmetric.com.

Translators Reference Guide V12.1 5


Polygonal
Translators
1
InnovMetric Software’s products are bundled with a set of polygonal file format translators. The InnovMetric
directory tree contains a translator program for each file format supported by InnovMetric Software. Each
translator program transforms an external format into InnovMetric Software’s internal format, and
conversely.

This chapter describes the polygonal translation strategy implemented by InnovMetric Software. Features
specific to particular formats are also presented.

Translators Reference Guide V12.1 6


Polygonal Translators Information extracted from polygonal files

1.1 Information extracted from polygonal files


InnovMetric Software’s products can read and write three types of 3D models:

 Polygonal models with no texturing or color-per-vertex information.

 Polygonal models that are partially or completely textured.

 Polygonal models with color-per-vertex information for all vertices.

The last two types cannot be mixed into one model file. If such a case occurs, the
invoked translator program would preserve texturing information first, disregarding
color-per-vertex information.

The following information is read and written by polygonal translators:

 Grouping information.

 Group labels.

 Material properties.

 Vertex normals.

 Texture image file names and texture coordinates.

Table 1 that follows shows the type of information that is extracted by four polygonal
translators provided by InnovMetric Software. All these translators are bidirectional,
which is to say that they can read and write polygonal files.

Table 1: Information extracted by polygonal translators

DXF OBJ STL VRML

Groups Layers Groups No Separators


Type of Information

Group labels Layer names Group names No No

Materials Layer colors Material files No Yes

Normals No Yes No Yes

Texture No Yes No Yes

Translators Reference Guide V12.1 7


Polygonal Translators Controlling the DXF translator

1.2 Controlling the DXF translator


InnovMetric Software applications can write DXF files using either the 3DFACE or
POLYFACE primitive. When 3DFACE is used, a polygon is described by a list of (x,y,z)
coordinates. When POLYFACE is used, a polygon is described by a list of indexes
referring to a global list of vertices. Files written with POLYFACE are usually smaller since
vertices are shared among the polygons. However, some applications read 3DFACE
primitives faster. By default, the dxf translator writes DXF files using the POLYFACE
primitive.

To use the 3DFACE primitive, type:

dxf_3dface

To use the POLYFACE primitive, type:

dxf_polyface

1.3 Controlling the IGES translator


InnovMetric Software’s write-only IGES translator can generate models using the
Rational B-Spline Surface Entity (Type 128) or Plane Entity (Type 108). By default, Entity
Type 128 is used.

To use the Entity Type 108, type:

iges_108

To use Entity Type 128, type:

iges_128

Translators Reference Guide V12.1 8


Polygonal Translators Controlling the STL translator

1.4 Controlling the STL translator


InnovMetric Software’s products can read and write both ASCII and binary STL files, and
offer three different STL translators. When a STL file is input to an InnovMetric Software
application, you have to specify the name of the appropriate STL translator.

The ASCII STL translator is:

stla

The binary STL translator is:

stlb

The third STL translator is:

stl

By default, the stl translator reads/writes binary STL files. To read/write ASCII files with
the stl translator, type:

stl_ascii

To go back to binary mode, type:

stl_binary

Translators Reference Guide V12.1 9


Polygonal Translators Controlling the VRML translator

1.5 Controlling the VRML translator


InnovMetric Software’s VRML translator can write files using versions 1.0 or 2.0 of the
VRML format. By default, the VRML translator writes files using version 2.0. To write
VRML files using version 1.0, type:

vrml_1

To go back to version 2.0, type:

vrml_2

1.6 Hints
If you are processing a texture-mapped model or an OBJ file using materials, the file
input to an InnovMetric Software product will usually contain references to one or
several external files. These external references may be expressed using a path relative
to the position of the input model file. To preserve these relative paths, the output files
created by an InnovMetric Software product should be placed in the directory
containing the input model file; otherwise, the relative paths will be transformed into
absolute paths.

Translators Reference Guide V12.1 10


Image Translators 2
InnovMetric Software’s products are bundled with a set of image file format translators. This chapter
describes the image translation strategy implemented by InnovMetric Software.

Translators Reference Guide V12.1 11


Image Translators Image translation strategy

2.1 Image translation strategy


InnovMetric Software’s products process input texture images as follows:

 First, the file extension is extracted. If the extension corresponds to the name of an
image translator, the translator program is directly invoked.

 Otherwise, a list of format magic numbers is inspected in order to identify the input
image file format. If the image magic number is matched with a supported image
format, the image is immediately translated.

 If the input image format is not supported, it is not translated. However, the image
file name is kept within the internal software structures, and written in the polygonal
files generated by InnovMetric Software’s products. Therefore, a texture-mapped
model may be successfully processed by an InnovMetric Software product even
though it uses a texture map expressed in an unsupported file format.

2.2 Hints
All InnovMetric Software products support 24-bit RGB images and 32-bit RGBA images.
Gray scale images are internally converted to 24-bit images.

Translators Reference Guide V12.1 12


IMConvert and
IMSlice
3
This chapter describes IMConvert, a translation and slicing utility bundled with IMEdit, InnovMetric
Software’s polygon editing tool. The IMSlice program is also provided to automatically produce three sets of
orthogonal slices along the X axis, the X axis, and the Z axis. You need a basic IMEdit key to have access to
IMConvert’s translation capabilities. In addition, slicing operations are only accessible to those who have
purchased a slicing option.

IMConvert is a command line program. Please ensure that IMEdit has been properly installed on your system
before trying to use it.

Translators Reference Guide V12.1 13


IMConvert and IMSlice A general call to IMConvert

3.1 A general call to IMConvert


A general call to IMConvert has two possible formats:

imconvert input_model_file

[-fi model_format]

(-o output_model_file) | (-fo model_format)

[-divide value]

[-multiply value]

[-pose pose_file]

[-slice slicing_step]

[-closure value]

[-start x y z]

[-verbose]

imconvert input_model_file

[-fi model_format]

(-o output_model_file) | (-fo model_format)

[-divide value]

[-multiply value]

[-pose pose_file]

[-cloud]

[-closure value]

[-start x y z]

[-verbose]

Note that the -slice and -cloud parameters are mutually exclusive.

Translators Reference Guide V12.1 14


IMConvert and IMSlice Basic parameters

3.2 Basic parameters

3.2.1 Specifying an input model file

An input model file to IMConvert must be specified. This file should contain the
description of a polygonal model written in a format supported by InnovMetric
Software.

Specifying the model format

Two methods can be used to specify the format in which a model file is written. If the
file has an extension that is a format name, IMConvert automatically selects the
translator program corresponding to this format. Otherwise, you have to use the -fi
parameter with the format name as an argument.

Examples

Let us assume that the fmt model format is supported by IMConvert. Then, the
following sequences are valid methods that allow specifying an input model file
written in this format:

model.fmt

model.xyz -fi fmt

model.fmt -fi fmt

3.2.2 Translating an input model file to another format

IMConvert may be used to convert an input model file to another supported polygonal
format.

Specifying the output model file name

The -o parameter may be used to simultaneously specify the output model file name
and the output polygonal format. If the specified file name has an extension that is a
format name, IMConvert automatically selects the translator program corresponding to
this format. Otherwise, you have to use the -fo parameter (description follows) to
specify a format.

Translators Reference Guide V12.1 15


IMConvert and IMSlice Basic parameters

Specifying the output polygonal format

With the -fo parameter, you can specify a polygonal format for the output model file.
The -fo argument must be a polygonal format that can be written by IMConvert.

3.2.3 Scaling a polygonal model

IMConvert allows you to scale a polygonal model input from a file. Two scaling methods
are available. The -divide parameter may be invoked to divide all (x, y, z) point
coordinates by a specified value. The -multiply parameter may be invoked to
multiply all (x, y, z) point coordinates by a specified value.

3.2.4 Applying a transformation matrix to a polygonal model

Every InnovMetric Software interface offers the View > Custom Views > Save command
that saves the model pose to a file. A pose file contains the rigid transformation matrix
applied to the model prior to rendering it on the computer screen. The -pose
parameter allows you to specify the path to a pose file to IMConvert. The
transformation matrix read from the pose file is applied to the input model.

3.2.5 Getting feedback

If the -verbose parameter is invoked, various messages are sent to the standard
output; otherwise, IMConvert is silent.

Translators Reference Guide V12.1 16


IMConvert and IMSlice Slicing a polygonal model using IMConvert and IMSlice

3.3 Slicing a polygonal model using IMConvert and IMSlice


IMConvert provides a slicing utility. An input polygonal model may be sliced along the
Z axis using the following syntax:

imconvert input_file -fo slice_format -slice slicing_step

The slicing algorithm translates a slicing plane, parallel to the X-Y plane, along the Z axis
by slicing_step increments. For every slicing plane position, the algorithm computes the
exact intersection between the plane and the input model, thus extracting one or
several polylines representing the intersection. The resulting polylines are then saved
to an external file. Supported formats for slices include dxf (Autodesk), igs (IGES), and
iv (Inventor).

3.3.1 Specifying a starting point for the slicing algorithm

By default, the first slice is located at the smallest z value of the input model. To modify
this behavior, you can specify the (x, y, z) coordinates of a starting point using the -
start parameter. This starting point does not have to be part of the input model. The
slicing algorithm uses it as a reference point and automatically determines the number
of slicing_step increments that must be added or subtracted to obtain a first slice lying
inside the input model’s bounding box.

3.3.2 Automatically closing small gaps in the polygonal model

IMConvert computes mathematically perfect slices of a polygonal model. Therefore,


any tiny hole in a polygonal model will result in slices consisting of several
disconnected polylines. The -closure parameter can be used to automatically
connect neighboring polylines during the slicing operation. This parameter specifies a
3D distance. Two polyline endpoints will be automatically connected if the polyline
orientation vectors are compatible at the endpoints and if the endpoints are located at
a distance smaller than the one specified using the -closure parameter.

3.3.3 Slicing along an arbitrary axis

IMConvert also allows the slicing of a model along an arbitrary axis. To achieve this
operation, the -pose parameter should be used to apply a transformation matrix to
the input model prior to slicing it. The slicing algorithm will then translate the slicing
plane along the Z axis of the new coordinate system. Afterward, the inverse
transformation is applied to the slices to bring them back to the coordinate system of
the original model. It should be noted that this transformation matrix is also applied to
a starting point specified using the -start parameter.

Translators Reference Guide V12.1 17


IMConvert and IMSlice Saving a polygonal model to a point cloud file

3.3.4 Using IMSlice to produce three sets of orthogonal slices

IMSlice allows you to automatically produce three sets of orthogonal slices along the X
axis, the X axis, and the Z axis. IMSlice manages three distinct calls to IMConvert. A
general call to IMSlice has the following format:

imslice input_model_file

[-fi model_format]

-o output_model_file

-fo model_format

-slice slicing_step

[-start x y z]

[-closure value]

[-verbose]

The IMSlice parameters have exactly the same meaning as their IMConvert equivalent.
IMSlice inserts an identifier in the specified output file name to identify the slicing axis.
If the output file name is base.ext, the generated files will be base_x.ext, base_y.ext, and
base_z.ext.

3.4 Saving a polygonal model to a point cloud file


If the -cloud parameter is invoked, the set of vertices that belong to the input
polygonal model is saved to an ASCII point cloud file. The following syntax should be
used to perform this operation:

imconvert input_file -o output_file -cloud

The -pose, -divide, and -multiply parameters may be used to transform or scale
the model coordinate system prior to saving the set of polygonal vertices.

Translators Reference Guide V12.1 18

You might also like