insert operation

Synopsis

i(geometryPath)

i(geometryPath,upAxisOfGeometry)

i(geometryPath,upAxisOfGeometry,insertMode)

Parameters

Reads a geometry asset (3D model, polygon mesh) from a file and inserts it into the scope of the current shape. The asset is transformed such that its bounding box coincides with the scope.

If one or more of the scope's sizes sx, sy and sz (i.e. width, height or depth) are zero the scope is modified as follows:

If the current shape has trim planes (generated in a component split), the model is cut with the trim planes.

Supported Asset Formats

Currently, the Wavefront OBJ and the COLLADA DAE formats are supported as asset formats.

The OBJ reader imports the material description file (.mtl) and it also understands negative indices (referencing from current position backwards). It will silently drop unsupported geometry/material tags and will also delete normals or texture coordinates of inconsistent meshes.

The COLLADA reader imports unlimited scene graphs and also reads transformation nodes. Extra tags are ignored and it will also delete normals and texture coordinates of inconsistent meshes.

Remarks:

Related

Examples

Window insertion


Insert a
Lot-->
   extrude(47)
   comp(f){side : Facade  |
           top :  X }	
	
Facade-->
   split(y) { { ~1 : X | 
                ~8 : Floor }* |
              ~1 : X }
			   
Floor-->
   split(x) { { ~1 : X |
                ~5 : Window }* |
              ~1 : X }
			
The rules above yield the subdivided mass model on the left.
			   
Window-->
	i("window.obj")                          
			
The effect of inserting a window model in the Window rule is shown on the right.

Insertion and Zero Scope Dimensions


Insert Zero a


The asset which is going to be inserted, displayed in the inspector. The asset's coordinates contain a translation of (12.3, 4.3, 7.2).

Insert Zero a
Head-->
	s(0,0,0)	
	i("beethoven.obj") 	
	
Inserting an asset into a shape with a zero-sized scope sets the scope's size to the asset's dimensions and translates the scope such that the asset's position is preserved. Note that the translation relative to the shape's pivot (small axes on the left) is identical to the translation of the asset in the inspector, relative to the origin (picture above).

Insert Zero c
Head-->
	s(9,0,0)	
	i("beethoven.obj") 	
	
If the scope size is non-zero in one dimension, the two other dimensions are set relative to the non-zero dimension. The same is valid for the scope translation along the zero-dimensions. In the picture on the left, the original scope is shown (it is one-dimensional along the x-axis).

Insert Zero b
Head-->
	s(9,9,0)	
	i("beethoven.obj") 	
	
If one of the scope sizes is zero, the scope's size is modified relative to the average of the two non-zero sizes. Note that the position of the scope is not modified.

Trim Planes and Insertion


Insert a
Lot-->
	primitiveCube()
	s(10,40,10)
	t(-5, 0, -5)
	comp(f) { side: Side }
	
Side-->
	t(0,0,-5)
	s('1,'1,10)			 
	i("cylinder.vert.obj") 
	
The cylinder model, shown on the left, is inserted at the four side-faces of a cube.

Insert a
The inserted cylinders are cut with the trim planes generated by the component split.
In the picture on the left, the geometry of one Side shape (i.e. the cut cylinder) and its trim planes are highlighted.
On the right is the smae scene from top view (top), and a close-up of the upper area (bottom).

Insert a
Lot-->
	primitiveCube()
	s(10,40,10)
	t(-5, 0, -5)
	comp(f) { side: Side }
	
Side-->
	t(0,0,-5)
	s('1,'1,10)			 
	set(trim.vertical, false)
	i("cylinder.vert.obj") 
	
Note how disabling the trim planes just before the insert operation changes the resulting geometry.

Copyright ©2008-2016 Esri R&D Center Zurich. All rights reserved.