Software – Geospatial Modeling & Visualization / A Method Store for Advanced Survey and Modeling Technologies Thu, 22 Mar 2018 11:44:45 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 Working with the Vue interface with Python /modeling/working-with-the-vue-interface-with-python/ Thu, 04 Oct 2012 16:15:52 +0000 /?p=11575 Continue reading →]]> [wptabs style=”wpui-alma” mode=”horizontal”] [wptabtitle]Passing arguments[/wptabtitle]
[wptabcontent]
The snippet below launches Vue from a Python script and passes in two arguments to Vue, ARG1 and ARG2:

import subprocess
command = [r"C:\Program Files\e-on software\Vue 10.5 Infinite\Application\Vue 10.5 Infinite", "-p'D:\\Temp\\bat-test.py' ARG1 ARG2"]
result = subprocess.Popen(command)


[/wptabcontent] [/wptabs]

]]>
Working with objects in Vue with Python /modeling/working-with-objects-vue-python/ Thu, 04 Oct 2012 16:13:58 +0000 /?p=11527 Continue reading →]]> [wptabs style=”wpui-alma” mode=”horizontal”]
[wptabtitle]Get the size of an object[/wptabtitle]
[wptabcontent]Getting the actual size of an object in Vue programmatically isn’t as easy as you’d think. You essentially have to get the BoundingBox of the object and work with that. So here we have a wind turbine object, and we have selected the pole and need to know (programmatically) how tall this pole really is.

wind turbine object in Vue

If you look at that z-value in the size properties, you see that it’s 76.045m tall. To get that height programmatically (result on line 21):

#
#
>>> col = GetSelectedObjectByIndex(0)
>>> col
>>> scale = col.GetScale()
>>> print scale
(1.0, 1.0, 1.0)
>>> bb = col.GetBoundingBox()
>>> print bb
<VuePython.VUEBoundingBox; proxy of <Swig Object of type 'VUEBoundingBox *' at 0x0000000017884360> >
>>> print bb.GetMax()
(4024.3647753980426, -9026.798040135702, 216.7754350035159)
>>> print bb.GetMin()
(4019.764775016573, -9031.39804242452, 140.730600866553)
>>> 

# Do the math

>>> z_size = bb.GetMax()[2] - bb.GetMin()[2]
>>> print z_size
76.044834137
>>> 

# Make a dict out of em

>>> d = {}
>>> d['Min'] = bb.GetMin()
>>> d['Max'] = bb.GetMax()
>>> print d
{'Max': (4024.3647753980426, -9026.798040135702, 216.7754350035159), 'Min': (4019.764775016573, -9031.39804242452, 140.730600866553)}
>>>
>>> print d['Max'][2]
216.775435004
>>>
#
#

 
[/wptabcontent]
[wptabtitle] Multiple cameras[/wptabtitle]
[wptabcontent]
Turns out there is no Python method in the Vue API for creating a camera. In order to create cameras, you can duplicate the Main camera and then call your custom cameras by index, where the index is the ID number of the camera.

#
#
# Dict of KOPs and attributes
# {KOP ID: (northing, easting, cam z position, FoV,    
#           camera yaw, camera pitch,  sun pitch, sun yaw)}
d = {5: ('15980.6638981', '6893.65640636', '3.7', 'Center', 
         '344.064664362', '93', '116.821439116', '120.778962736'), 
     6: ('8647.62696908', '27858.4046614', '3.7', 'Center', 
         '283.801779018', '93', '116.693562607', '120.534961058')}

# Create new cameras by duplicating Main camera for each KOP
for k in d.iterkeys():
    sc = SelectByName("Main camera")
    camera = GetSelectedObjectByIndex(0)
    Duplicate()
    DeselectAll()

# Set start position to 2, as its zero based indexing and Main camera is 0, 
#  Top camera is 1, so our first custom camera will be 2
cam_start_pos = 2

# For each pair in kop dict, map it to a new dict, where key is camera 
#  index and value is kop dict kv pair
#  {2:{'5': ('15980.6638981', '6893.65640636', '3.7', 'Center', 
#            '344.064664362', '93', '116.821439116', '120.778962736')},
#   3:{'6': ('8647.62696908', '27858.4046614', '3.7', 'Center', 
#            '283.801779018', '93', '116.693562607', '120.534961058')}}
i = 2
cams_kops = {}
for k, v in d.iteritems():
    cams_kops[i] = dict([(k, v)])
    i+=1
  
# Get the kop id (its a dict key) for a given camera id
cams_kops[2].keys() # 5

# Setup the camera for each KOP
select_camera = SelectByName("Main camera")
for k, v in cams_kops.iteritems():
    if SwitchCamera(k):  # k is camera id
        #kop_id = cams_kops[k].keys()[0]
        kop_attributes = cams_kops[k].values()[0]        
        camera = GetSelectedObjectByIndex(0)
        camera.SetPosition(float(kop_attributes[1]), 
                           float(kop_attributes[0]), 
                           float(kop_attributes[2]))
        Refresh()
        camera.SetRotationAngles(float(kop_attributes[5]), 
                                 0, float(kop_attributes[4]), true)
        Refresh()           
    else:
        # raise exception
        print "No"
        
    i+=1
    
# Create KOP/camera dictionary {KOP:camera id, ..} to associate each
#  KOP with its camera
kop_camera_ids = {}
for camera_id, kop_id in cams_kops.items():
    kop_camera_ids[kop_id.keys()[0]] = camera_id
    
print kop_camera_ids

SwitchCamera(0) # Activates "Main camera" again

# Now to switch the camera to a known KOP ID's camera, just do:
SwitchCamera(kop_camera_ids[6]) # call camera by the KOP ID
#
#

This results in two new cameras, Main camera0 and Main camera1. The names of the cameras in the layer list are pretty much meaningless since you access them via index.

And here is what they look like from the Top view:

[/wptabcontent]
[wptabtitle]Add an array of cylinders[/wptabtitle]
[wptabcontent]
We needed to test and make sure that, when using a planetary sphere in Vue, objects are indeed placed on the curvature of sphere (in our case, the Earth). The following script adds a cartesian-like array of cylinders into a Vue scene. First we need to create the cartesian array of points:

import itertools
d = {}
count = 1
for i in itertools.product([0,100,200,300,400,500,600,700,800,900,1000],
                           [0,-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000]):
    d[count] = list(i)
    count += 1

Which gives us a dictionary of key/value pairs where the key is an id number and the pairs are the X/Y cartesian coordinates, spaced 100 units apart in the X and Y:

for each in d.items()
    print each

(1, [0, 0])
(2, [0, -100])
(3, [0, -200])
(4, [0, -300])
(5, [0, -400])
(6, [0, -500])
(7, [0, -600])
(8, [0, -700])
(9, [0, -800])
(10, [0, -900])
(11, [0, -1000])
(12, [100, 0])
(13, [100, -100])
(14, [100, -200])
(15, [100, -300])
(16, [100, -400])
(17, [100, -500])
(18, [100, -600])
(19, [100, -700])
(20, [100, -800])
(21, [100, -900])
(22, [100, -1000])
...
...
(111, [1000, 0])
(112, [1000, -100])
(113, [1000, -200])
(114, [1000, -300])
(115, [1000, -400])
(116, [1000, -500])
(117, [1000, -600])
(118, [1000, -700])
(119, [1000, -800])
(120, [1000, -900])
(121, [1000, -1000])

Now let’s add z-values to the X and Y lists so we have a height for each cylinder:

d2=d
for k, v in d2.iteritems():
    v.append(500)
    
for each in d2.items():
    print each
    
(1, [0, 0, 500])
(2, [0, -100, 500])
(3, [0, -200, 500])
(4, [0, -300, 500])
(5, [0, -400, 500])
(6, [0, -500, 500])
(7, [0, -600, 500])
(8, [0, -700, 500])
(9, [0, -800, 500])
(10, [0, -900, 500])
(11, [0, -1000, 500])
(12, [100, 0, 500])
(13, [100, -100, 500])
(14, [100, -200, 500])
(15, [100, -300, 500])
(16, [100, -400, 500])
(17, [100, -500, 500])
(18, [100, -600, 500])
(19, [100, -700, 500])
(20, [100, -800, 500])
(21, [100, -900, 500])
(22, [100, -1000, 500])
...
...
(111, [1000, 0, 500])
(112, [1000, -100, 500])
(113, [1000, -200, 500])
(114, [1000, -300, 500])
(115, [1000, -400, 500])
(116, [1000, -500, 500])
(117, [1000, -600, 500])
(118, [1000, -700, 500])
(119, [1000, -800, 500])
(120, [1000, -900, 500])
(121, [1000, -1000, 500])

Finally, here is the script to run on a 1km planetary terrain scene within Vue:

d_100s = {1:[0, 0, 500],
          2:[0, -100, 500],
          3:[0, -200, 500],
          4:[0, -300, 500],
          5:[0, -400, 500],
          6:[0, -500, 500],
          7:[0, -600, 500],
          8:[0, -700, 500],
          9:[0, -800, 500],
          10:[0, -900, 500],
          11:[0, -1000, 500],
          12:[100, 0, 500],
          13:[100, -100, 500],
          14:[100, -200, 500],
          15:[100, -300, 500],
          16:[100, -400, 500],
          17:[100, -500, 500],
          18:[100, -600, 500],
          19:[100, -700, 500],
          20:[100, -800, 500],
          21:[100, -900, 500],
          22:[100, -1000, 500],
          23:[200, 0, 500],
          24:[200, -100, 500],
          25:[200, -200, 500],
          26:[200, -300, 500],
          27:[200, -400, 500],
          28:[200, -500, 500],
          29:[200, -600, 500],
          30:[200, -700, 500],
          31:[200, -800, 500],
          32:[200, -900, 500],
          33:[200, -1000, 500],
          34:[300, 0, 500],
          35:[300, -100, 500],
          36:[300, -200, 500],
          37:[300, -300, 500],
          38:[300, -400, 500],
          39:[300, -500, 500],
          40:[300, -600, 500],
          41:[300, -700, 500],
          42:[300, -800, 500],
          43:[300, -900, 500],
          44:[300, -1000, 500],
          45:[400, 0, 500],
          46:[400, -100, 500],
          47:[400, -200, 500],
          48:[400, -300, 500],
          49:[400, -400, 500],
          50:[400, -500, 500],
          51:[400, -600, 500],
          52:[400, -700, 500],
          53:[400, -800, 500],
          54:[400, -900, 500],
          55:[400, -1000, 500],
          56:[500, 0, 500],
          57:[500, -100, 500],
          58:[500, -200, 500],
          59:[500, -300, 500],
          60:[500, -400, 500],
          61:[500, -500, 500],
          62:[500, -600, 500],
          63:[500, -700, 500],
          64:[500, -800, 500],
          65:[500, -900, 500],
          66:[500, -1000, 500],
          67:[600, 0, 500],
          68:[600, -100, 500],
          69:[600, -200, 500],
          70:[600, -300, 500],
          71:[600, -400, 500],
          72:[600, -500, 500],
          73:[600, -600, 500],
          74:[600, -700, 500],
          75:[600, -800, 500],
          76:[600, -900, 500],
          77:[600, -1000, 500],
          78:[700, 0, 500],
          79:[700, -100, 500],
          80:[700, -200, 500],
          81:[700, -300, 500],
          82:[700, -400, 500],
          83:[700, -500, 500],
          84:[700, -600, 500],
          85:[700, -700, 500],
          86:[700, -800, 500],
          87:[700, -900, 500],
          88:[700, -1000, 500],
          89:[800, 0, 500],
          90:[800, -100, 500],
          91:[800, -200, 500],
          92:[800, -300, 500],
          93:[800, -400, 500],
          94:[800, -500, 500],
          95:[800, -600, 500],
          96:[800, -700, 500],
          97:[800, -800, 500],
          98:[800, -900, 500],
          99:[800, -1000, 500],
          100:[900, 0, 500],
          101:[900, -100, 500],
          102:[900, -200, 500],
          103:[900, -300, 500],
          104:[900, -400, 500],
          105:[900, -500, 500],
          106:[900, -600, 500],
          107:[900, -700, 500],
          108:[900, -800, 500],
          109:[900, -900, 500],
          110:[900, -1000, 500],
          111:[1000, 0, 500],
          112:[1000, -100, 500],
          113:[1000, -200, 500],
          114:[1000, -300, 500],
          115:[1000, -400, 500],
          116:[1000, -500, 500],
          117:[1000, -600, 500],
          118:[1000, -700, 500],
          119:[1000, -800, 500],
          120:[1000, -900, 500],
          121:[1000, -1000, 500]}
          
def get_object_size(vue_object):
    """ Takes a input Vue object, gets it's bounding box, then does the
        math to get the XYZ size of the object. Returns a X,Y,Z tuple of
        the object size.
    """
    bounding_box = vue_object.GetBoundingBox()
    bb_min = bounding_box.GetMin()
    bb_max = bounding_box.GetMax()
    # Build our tuple of object XYZ size
    object_size = (bb_max[0] - bb_min[0], bb_max[1] - bb_min[1],
                   bb_max[2] - bb_min[2])
    return object_size

i = 1
for k, v in d_100s.iteritems():
    AddCylinder()
    cyl = GetSelectedObjectByIndex(0)
    cyl.SetPosition((v[0]), (v[1]), v[2]/2)
    Refresh()
    # Get Z size of object
    orig_z = get_object_size(cyl)[2]
    print orig_z
    cyl.ResizeAxis(10, 10, (v[2])/orig_z)
    Refresh()
    DeselectAll()
    i += 1

And the end result is this:

Now, granted this isn’t the most practical script, but it does show how a little bit of work with itertools, dictionaries, and the Vue API lets you place a massive amount of objects into a scene relatively painlessly and quickly.

[/wptabcontent]
[/wptabs]

]]>
Unity Pro vs Unity Indie /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/unity-pro-vs-unity-indie/ Sat, 11 Aug 2012 11:53:42 +0000 /?p=11463 Continue reading →]]> Unity Indie is a free version of the Unity3D software. It allows anyone to use a modern advance game engine to create interactive realtime 3D visualizations for Windows, Mac, Web player and soon, Linux.

The chief differences between Unity Indie and Unity Pro lies in the ability to optimize your scenes and the ability to create scable worlds. Its significant to point out that most of these features in Unity Pro can be imitiated to a certain degree in Indie using code and modeling software.

[wptabs mode=”vertical”] [wptabtitle] Intro to Static Batching[/wptabtitle] [wptabcontent]Graphics cards can process many polygons with relative ease. The texture mapped onto those polygons tend to be the source of rendering and performance problems. Whenever you test out your Unity application by hitting play, Unity renders on screen everthing that is aligned with the camera (or view frustrum). Every object using a different material within the field of vision gets sent to the graphics card for processing. Unity does this in passes. Everything in the back is rendered first working its way to the front.
Every object getting sent one by one to the GPU is a fairly inefficient procedure. If there are a number of individual models pointing to the same material, Unity can combine these models at runtime reducing the amount of data that is sent to the GPU. Unity in effect renders or “draws” these combined meshes in one batch or “call”. Unity does this to some degree already with dynamic batching (included in the indie version). But the most significant gains come when you can tell Unity which models you’d like grouped together. This is where static batching comes in (only available in the Pro version).
[/wptabcontent]
[wptabtitle] Tag a Static Batch Object[/wptabtitle] [wptabcontent]When you tag an object as static batched, then Unity will group that object in with other objects that share the same material.

Go to Edit > Project Settings > Player

Check Static Batching


[/wptabcontent]

[wptabtitle] Specify the models[/wptabtitle] [wptabcontent]Now you’ll want to tell Unity which models should use static batching. Remember, static batching is only effective on models that share the same texture and material. Duplicates of objects and models using texture atlases are your prime targets.


[/wptabcontent]
[wptabtitle] Static Batching Statistics[/wptabtitle] [wptabcontent]
-Select a prefab in the Project panel or select a GameObject in the Hierarchy.

-In the top right corner of the Inspector, click on the triangle next to Static. A drop down menu appears. Select Batching Static. We’ll talk about some of the other static options in a moment.

-When you click play, you can see how many models are being batched at any given time by click on the Stats button in the upper right corner of the Game panel. You should see a decrease in the Draw Calls also when you enable Static Batching.


[/wptabcontent]
[wptabtitle] Introducing Occlusion Culling [/wptabtitle] [wptabcontent]I mentioned above that Unity renders everything in the back first and then everything towards the camera. This means that if you look at a wall in Unity everything behind that wall is getting rendered as well and affecting performance. This seems inefficient and impractical. You could have a sprawling city behind that wall and have it affecting your performance. This is where occlusion culling comes in.

Occlusion culling keeps track of what is visible from any given location via a 3D grid of cells called Potentially Visible Set (PVS). Each cells contains a list of what other cells are visible and which are not. Using this information, Unity can render only that which is visible significantly decreasing the amount of data that needs to be processed to render the scene.

Setting up occlusion culling is fairly straightforward, but keep in mind, depending on the scale of your scene, the baking process could take from 30 minutes to a couple of hours.
[/wptabcontent]
[wptabtitle] Setting up Occlusion Culling[/wptabtitle] [wptabcontent]1. Select all the stationary GameObjects
2. In the top right corner of the Inspector, click the triangle next to “Static
3. Select “Occluder Static”
4. Drag and drop your First Person Controller into the scene.
5. Now go to Window > Occlusion Culling

A new window opens called “Occlusion” along with a 3D grid in the scene view. The 3D grid represents the size of the cell grid the OC process will use. As it stands, the entire scene will be used in occlusion culling.

[/wptabcontent]
[wptabtitle] Bake Occlusion Culling[/wptabtitle] [wptabcontent]6. Click on the “Bake” tab. You’ll see the settings for the Occlusion Culling.

7. Click on “Bake” and go get some lunch. When the baking finishes, click Play and make sure you do not have geometry that suddenly appears and disappears. You can move the Game view so that it is adjacent to the Scene view. You can see how only the geometry you are viewing in the Game view is the only geometry visible in the scene view and whenever you rotate and move the geometry appears and reappears as needed. This should drastically reduce any frame rate issues. [/wptabcontent]
[wptabtitle] Introducing Lightmapping[/wptabtitle] [wptabcontent]When you have lights casting realtime shadows in your scene, the frame rate can be greatly affected as every pixel of an object reflecting light has to be calculated for the right affect and the shadows have to be calculated as well. Lightmapping is a process that “bakes” or draws the shadows and lighting effects onto the textures of an object so that at runtime no light calculations need to be processed. An additional advantage is also that lightmapping can add ambient occlusion to a scene that adds an element of realism and softness to the scene. The setup is similar to Occlusion Culling, but it can take even longer. This is very much an all night process, so be sure to start it before leaving the day, if the scene is large or uses many materials.

As with everything else, you must tag the objects you want to have a lightmap for.
[/wptabcontent]
[wptabtitle] Setting up Lightmapping[/wptabtitle] [wptabcontent]1. In the top right corner, click on the triangle next to “Static” and check “Lightmap Static”
2. Go to Window > Lightmapping
3. Click on the Bake tab. The settings for lightmapping appear and at first glance they are daunting. For most situations though, the default settings should do fine. The main thing to look for is to see that “Ambient Occlusion” is at least .4 if you want to add Ambient Occlusion to your scene.
5. Click Bake and call it an evening (depending on the scene size)


[/wptabcontent] [/wptabs]

]]>
Creating a Terrain in Unity From a DEM /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/creating-a-terrain-in-unity-from-a-dem/ Sat, 11 Aug 2012 11:31:55 +0000 /?p=11449 Continue reading →]]> Getting DEMs translated into a form Unity understands can be a bit tricky, and as of yet no perfect solution exists . Nevertheless, DEMs are excellent ways to acquire terrain and elevation models for a variety of purposes. Racing games created in Unity make extensive use of DEMs for levels as well as architectural visualizations. Beware though that accuracy tends to be an issue.

There are two main ways to translate DEM data into Unity. One way is to convert a DEM into a Raw heightmap. The other is to convert a GridFloat dem into a Unity terrain

[wptabs mode=”vertical”] [wptabtitle] Using Terragen/3DEM[/wptabtitle] [wptabcontent]The goal of this method is to convert the DEM into a RAW heightmap that Unity reads natively. For many users of Unity, the most cost effective solution is to use a two step rocess using Terragen and 3DEM, but if you can obtain a heightmap from DEM by any other means, you can skip to the Import into Unity section. [/wptabcontent]

[wptabtitle] Convert DEM to Terragen File[/wptabtitle] [wptabcontent]The first step is to convert the DEM into a Terragen file. We use the free program 3DEM, which you can download here.

1. Open 3DEM.
2. Choose the format of the DEM in question


[/wptabcontent]
[wptabtitle] Define the export area[/wptabtitle] [wptabcontent]3. Select an area you wish to export.

[/wptabcontent]

[wptabtitle] Extract the export extents[/wptabtitle] [wptabcontent]4. Here’s the tricky part. The selection box does not give us any information concerning the width, length and elevation of the selected area and Unity will need this information. We will have to point our cursor in severa spots inside the selection box to extract this data. When you move the cursor, the Northing, Easting and Elevation info appears in the lower right hand corner.

We can use this to extract the width of the selection box. If we point the cursor on the left edge of the box and then the right edge, we subtract the value from each and find the width of the box. Similarly, if we find the lowest elevation and subtract it from the highest elevation, we have our elevation height that Unity will need.
6. File > SaveTerragen Terrain > Selected Area and save it in an accessible area [/wptabcontent]

[wptabtitle] Export from Terragen to RAW[/wptabtitle] [wptabcontent]7. Now open Terragen
8. Open the .ter file you exported from 3DEM. The area you selected should now appear in the Landscape and the Rendering Control dialog.
9. Go to Export > Terrain > Export Make sure it is 8 bit Raw.


[/wptabcontent]

[wptabtitle] Import into Unity[/wptabtitle] [wptabcontent]10. Now open Unity
11. Go to Terrain > Create Terrain. A large terrain will appear in the scene view.
12. Go to Terrain > Import Height – Raw… and select the raw file we exported from Terragen
13. The Import Height dialog appears. You’ll need the data we collected from step 4 and enter it into the correct slots. The width and height of the selection box go into the X and Z. The elevation difference goes into Y. Check and make sure the Depth is 8bit, (if you used Terragen) and that the Byte order is your respective OS. Click OK.

[/wptabcontent]

[wptabtitle] The result[/wptabtitle] [wptabcontent]Unity will create the terrain from the DEM. In the scene view, the terrain may appear pixelated with jagged edges, but this is mainly due to the Scene view using LOD to render the terrain. If you drop a First Person Controller onto the terrain and hit play, the terrain will appear smooth.


[/wptabcontent]
[wptabtitle] Using GridFloat format[/wptabtitle] [wptabcontent]If the DEM is in the GridFloat format, then you can enable Unity to read into a Unity terrain. You’ll need to download the script to do this from here. Be sure the header file (HDR) for the GridFloat DEM also resides in the Asset folder.

1. Create a folder in Unity called ‘Editor’
2. Copy the HeightmapFrom GridFloat to the Editor folder.
Placing scripts into an “Editor” folder in Unity actually extends the Unity editor. Now a menu will appear underneath Terrain at the top called ‘Heightmap From GridFloat”
[/wptabcontent]
[wptabtitle]Create the terrain in the scene[/wptabtitle] [wptabcontent]

3. Select the .flt file in the asset folder. (Be sure you have the hdr file as well)
4. Go to Terrain > Heightmap From GridFloat.

The terrain should appear in the scene view.
[/wptabcontent] [/wptabs]

]]>
Basic Interaction and Scripting in Unity /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/basic-interaction-and-scripting-in-unity/ Sat, 23 Jun 2012 12:01:35 +0000 /?p=10291 Continue reading →]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”] [wptabtitle] Get Some Scripts[/wptabtitle] [wptabcontent]This tutorial will describe a basic setup for adding simple interactions to the walkable demo we created in the previous tutorial. To do this, you’ll use several scripts contained in the package you can download here.

Have Unity open with the project used in the last tutorial

Download it and double click on it with Unity open.

Import all the scripts.[/wptabcontent]
[wptabtitle] Script Documentation[/wptabtitle] [wptabcontent]
The scripts are documented, if you would like to view them and learn more. You can find additional resources concerning the Scripting API in Unity at the Unity Script Reference page. [/wptabcontent]

[wptabtitle] Unity Scripting Languages[/wptabtitle] [wptabcontent]Unity allows you to create in scripts in three languages: JavaScript, Boo, and C#.

JavaScript is well known for web scripting and is part of the same standard as Flash’s ActionScript. Unity’s JavaScript has notable differences, but it provides the easiest way to interface with GameObjects.

C# is native to .NET and the Mono project, which Unity is based on. It provides many advance options that JavaScript lacks.

Boo is a lesser known language. Not many people code in Boo, but it has many similarities to Python.
[/wptabcontent]

[wptabtitle] The Museum Scripts[/wptabtitle] [wptabcontent]The package contains three scripts:

ArtifactInformation.js : This is a basic data repository script. When you add it to a GameObject, you’ll be able to enter basic information about the object in the inspector that can be shown when the user clicks on the object. Place it on each artifact you wish to interact with.
We could obtain the information in a number of ways, MySQL database, XML, etc. For this demo, we are mainly worried with what to do with the data once we receive it.

ObjectRotator.js : This script allows us to rotate the object when we click on it. It also needs to be attached to each object you want to interact with.

ArtifactViewer.js : This script is attached to the FPC’s main camera. This script will detect if we are looking at an object when we left mouse click. If an object is in front, it will deactivate the FPC, show the information of the object and activate object rotate mode. It must go on the Main Camera inside the First Person Controller. [/wptabcontent]

[wptabtitle] Setup a Sphere Collider[/wptabtitle] [wptabcontent]We need to perform several steps to prepare the script for activation. I assume you have placed an artifact on one of the pedestals in the museum. Be sure to make the scale factor of .005. Otherwise, hilarity will ensue. Leave the Generate Colliders box unchecked.

Add a Sphere Collider

1. With the object selected, go to Components > Physics > Sphere Collider


This allows us to detect if we are in front of the object.

[/wptabcontent]

[wptabtitle] Add New “Artifact” Tag[/wptabtitle] [wptabcontent]1 .With the object selected, go to the top of the Inspector and click the drop down menu next to Tag and click Add Tag.

2. Open the Tag hierarchy and in Element 3, add the text “Artifact”.

3. Go back to the object’s properties in the Inspector, and make sure the newly created “Artifact” tag appears in the Tag drop down menu.

4. Do this for all artifacts you wish to interact with.

5. Select the FPC and assign the “Player” tag to it. The “Player” tag should already exist in Unity
[/wptabcontent]

[wptabtitle] Attach Scripts[/wptabtitle] [wptabcontent]1. Find the folder “Museum Scripts” in the Project panel.

2.Drag the scripts “ArtifactInformation” and “ObjectRotater” to each object you wish the user to interact with.

3.The “ArtifactViewer” script has to go in a special place on the FPC. Expand the FPC in the Hierarchy panel and locate the “Main Camera” inside of it.

4.Drag the ArtifactViewer on to the “Main Camera.” [/wptabcontent]

[wptabtitle] Add info about the artifacts[/wptabtitle] [wptabcontent]Now if you select the artifact, you’ll find where you can enter information about the artifact. You can copy and paste data from the Hampson site or come up with your own.

NB: Although the Artifact Description doesn’t show much of the text, it really does have a block of text in it.

[/wptabcontent]

[wptabtitle] Finished Museum Demo[/wptabtitle] [wptabcontent]Now if you click Play, you can click on the object and a GUI with information appears. Left clicking will also allow you rotate the model. If the rotation seems off, the pivot point may not be in the center.


You should now have a simple walkthrough demo of a museum.

This project was designed as a launching platform for more ambitious projects.
[/wptabcontent] [/wptabs]

]]>
A Walkable Unity Demo /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/a-walkable-unity-demo/ Sat, 23 Jun 2012 11:30:18 +0000 /?p=10259 Continue reading →]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”]
[wptabtitle] Intro[/wptabtitle] [wptabcontent]This chapter will show you how to put together a walkable demo of a simple museum using several models. The techniques in this tutorial can be applied in many ways. Although I use models from the Virtual Hampson museum as examples, you are welcome to use your own.

You will need to download the following model, or use one of your own:
https://dl.dropbox.com/u/22781413/museumdemo/simpleMuseum.zip

You can take a look at the final product here.

[/wptabcontent]

[wptabtitle] Create a new project[/wptabtitle] [wptabcontent]
Open Unity and go to File > New Project.

The New Project file dialog will come up.


Name the project “Museum Demo” and save it in a convenient location.

Below you will see the packages Unity comes with. A package is a set of scripts and assets that allow certain functionalities. For this demo, we will choose:

– CharacterController
– Skybox

Unity will open with an empty scene.
[/wptabcontent]

[wptabtitle] Import the model[/wptabtitle] [wptabcontent]Now we’ll import the simpleMuseum model. Either we can copy and paste the file into the asset folder using Explorer or we can drag and drop the file into the Project panel.


Click on the model in the Project panel, and its Import Settings will show up in the Inspector. You’ll want to do two things here.

1.Check the Generate Colliders box.

2. Adjust the scale factor. Every modeling application processes units differently. (For the simpleMuseum model, try a scale factor of .01 ).

[/wptabcontent]
[wptabtitle] Scene View[/wptabtitle] [wptabcontent]

Now we’ll drag and drop the model from the Project panel to the Scene view.
[/wptabcontent]
[wptabtitle] The First Person Controller[/wptabtitle] [wptabcontent]
It’s hard to see if the scale is off without another model for comparison so we’ll also drag and drop the First Person Controller into the scene.

You can find the First Person Controller* (FPC) by locating the Standard Assets folder in the Project panel and looking in the Character Controllers folder. You will see the 3rd Person Controller and the FPC .

NB: If you do not find the FPC, go to Asset > Import Package > Character Controllers and Import All.

Drag the (FPC) into the scene inside the museum model.

FPC is raised off the floor. If the FPC is partially through floor, the camera will fall to infinity. If the FPC is high above the green plane, it will fall until it collides with it.
[/wptabcontent]
[wptabtitle] FPC and model scale[/wptabtitle] [wptabcontent]The FPC is 2 units tall. Unity works best thinking the units in meters, but it mainly depends on the units used in the modeling application. If the model is larger or smaller relative to the FPC, you can adjust the Scale Factor accordingly. [/wptabcontent]

[wptabtitle] Preview the Model[/wptabtitle] [wptabcontent]Press the Play button at the top. This will compile the scripts and show you a preview. You can walk around using the arrow keys or WASD. You can look around using mouse movement. You can even jump with space bar. We’ll adjust these controls later.


If the camera falls through the model, either the FPC wasn’t raised enough off the floor or “Generate Colliders” wasn’t checked in the Import Settings. [/wptabcontent]

[wptabtitle] Scene Lighting[/wptabtitle] [wptabcontent]Likely, the preview will be dark and difficult to see clearly. Let’s add a light to the scene.


Unity provides three types of lighting typical for 3D applications: Spot, Directional, Point.

Point light is an omnidirectional point of light. Directional light imitates sun light from an angle. Spot light is a concentrated area light. To light an entire scene, we will add a directional light.

Click on GameObject > Create Other > Directional Light. [/wptabcontent]
[wptabtitle] Edit Unity Lighting[/wptabtitle] [wptabcontent]
Press E to go into rotate mode and rotate the light to obtain the desired lighting. The position of the light is irrelevant. You can change the color and intensity in the inspector while you have the Directional Light selected.

[/wptabcontent]

[wptabtitle] Invisible Colliders[/wptabtitle] [wptabcontent]Sometimes it’s convenient to be able to tightly control where users have access to. An easy solution for blocking user access is to place invisible colliders around the prohibited space.

You’ll definitely want to block access anywhere the user may fall infinity and break the user experience as in our current museum demo.

Adding invisible collider is very simple. We’ll start by adding a cube to the scene.

1.Go to GameObject > Create Other > Cube
2. Press ‘F” to focus on the cube

A cube appears in the scene view.

[/wptabcontent]
[wptabtitle] Moving the Cube 1[/wptabtitle] [wptabcontent]
We’ll move the cube to the edge of the green plane. We’ll use vertex snapping for moving objects next to other objects.

1. With the cube still selected, holding down ‘V’, a square gizmo will appear over the nearest vertex.

2. With ‘V’ still held down over the desired vertex, click LMB and the cube will snap to the nearest vertex of another object. Drag the cube so that it lines up next to the edge of the green plane.
[/wptabcontent]
[wptabtitle] Scaling the Cube[/wptabtitle] [wptabcontent]3. Now press ‘R’ to go into scale mode and scale the cube along the X axis(blue handle) along the full width of the green plane. Then scale the cube of the Y axis (green handle) so that the cube is taller than the FPC.

[/wptabcontent]

[wptabtitle] Hide the Cube[/wptabtitle] [wptabcontent]4. Finally, with the cube still selected, go to the Inspector and uncheck the box next to MeshRenderer.

This will render the cube invisible, but the collider will still be in effect.

[/wptabcontent]
[wptabtitle] Skybox Creation[/wptabtitle] [wptabcontent]
Now we can duplicate the object (Ctrl D) and reposition the duplicates adjacent to the other edges of the green plane.

Unity provides a number of skyboxes you can use. If you did not import the Skybox package when you created the project, you can import to Assets > Import Packages > Skyboxes, then click the Import button on the popup window.

Now go to Edit > Render Settings and in the inspector you’ll find Skybox Material.

Click on the little circle next to it and you’ll open the Material Browser. Unfortunately, it will show every Material existing in the project and will not cull out those only suitable for Skyboxes. But since Skybox materials usually have “sky” in the name, if you type “sky” in the search bar at the top, the browser will only show those materials suitable for Skyboxes. Unity provides various day and night time skyboxes.

[/wptabcontent]
[wptabtitle] Motion Adjustment[/wptabtitle] [wptabcontent]Most likely you will want to fine tune the motion controls and interactive experience of your walkthrough model. We’ll take a look at adjusting the speed of your movement, sensitivity of the mouse and look brief at how we can modify the scripts Unity comes with. [/wptabcontent]

[wptabtitle] Character Controller Menu[/wptabtitle] [wptabcontent]Select the FPC and you will see in the inspector how the FPC is constructed from individual components.

The Character Controller allows you to adjust the width and height of the FPC among other things.
[/wptabcontent]
[wptabtitle] The Character Motor Component[/wptabtitle] [wptabcontent]The Character Motor component allows you to adjust movement speed.

-Expand the Movement hierarchy and you’ll find the Max Forward, Sideways and Backwards Speed, as well as Gravity and Ground Acceleration.

-The most effective strategy for fine tuning is to be in Play Mode and adjust the values. Anytime you adjust a value it will be reflected in the Player. Once you have values that seem appropriate, either take a snapshot of the values or write them down. When you quit Play Mode, the values will reset to their original, and you must enter them in again.

You can also adjust the Jumping or disable it completely. It is unlikely you will need to worry about Moving Platform and Sliding.
[/wptabcontent]

[wptabtitle] Mouse Sensitivity[/wptabtitle] [wptabcontent]Looking around with the mouse may seem jarring or disorienting, but you can tweak these values so you can have a smooth experience. But we will have to look in two different locations. Unity handles X and Y rotation differently for the FPC. To adjust the mouse sensitivity in the X axis, with the FPC selected, look at the Inspector and find the Mouse Look component. MouseX should be selected in the Axes. Adjusting the Sensitivity X will adjust the mouse sensitivity in the X axes. Adjusting the Y will have no effect.

To modify the Y Sensitivy, select the FPC in the Hierarchy and expand it. You will find Graphics and Main Camera. Select main Camera and you the inspector will show another Mouse Look component. Adjusting the Sensitivity Y will modify your mouse movements up and down.

You can also decide how far the user can look up and down by adjusting the Minimum Y and Maximum Y values
[/wptabcontent]

[wptabtitle] Continue…[/wptabtitle] [wptabcontent]
These are the basics for a walkable demo in Unity. We will next look at adding a mechanism for gathering information in our walkable demo.

Extra:

A museum should have artifacts! Download several Hampson artifacts, import them and place them on the pedestals inside the museum structure. You can use them in the next tutorial. Be sure to use a scale factor of .005. Leave the Generate Colliders box unchecked.

Continue here…
[/wptabcontent] [/wptabs]

]]>
Importing Objects to Unity /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/importing-objects-to-unity/ Sat, 23 Jun 2012 10:42:22 +0000 /?p=10254 Continue reading →]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”]
[wptabtitle] Basic Importing[/wptabtitle] [wptabcontent]Unity3D reads these file formats natively:

-FBX : an AutoDesk format designed for interoperability

-.dae : Collada format *

-. 3ds: 3D Studio Max

-.dxf : Drawing Interchange Format, a format used for interoperability between AutoCad and other programs

-.obj : Wavefront Object, an open and fairly common 3D model format

If you are working in a 3D modelling application and are able to export in one of these formats, Unity will be able to read it. Export the file into the Assets folder and the object will appear in your Project panel in Unity. For best results, always import as .fbx or .obj files. Unity works best with these particularly when it comes to scale.

FBX Converter
Autodesk supplies a free FBX converter on their website. You can find it here: http://usa.autodesk.com/adsk/servlet/pc/item?id=10775855&siteID=123112. [/wptabcontent]
[wptabtitle] Automatic Import[/wptabtitle] [wptabcontent]Unity is able to automatically import a number of 3D models from the following proprietary vendor format. The links will take you to Unity’s reference manual where you can find a fuller discussion of the vendor format.

● Maya
● Cinema 4D
● 3ds Max
● Cheetah3D
● Modo
● Lightwave
● Blender

If you save the scene from any of these modeling packages to the Asset folder you are working in, Unity will automatically import them in the project. You can freely go to and fro Unity and the modeling package and all edits will be reflected in Unity.
[/wptabcontent]

[wptabtitle] 2D Assets[/wptabtitle] [wptabcontent]Similarly, Unity reads Photoshop files natively so you can save your .psd files straight into the Assets folder. It’s a good idea to create a folder named Textures to keep your files organized. Using the Photoshop documents natively allow you to make edits and see the results quickly in Unity. However, you may see a lost in quality using Photoshop Documents. To avoid this, try using 24 bit PNG files. An advisable organization strategy is to save your PSD files in a folder called PhotoshopOriginals and export the png files into the Texture folder in your Asset folder. [/wptabcontent]
[wptabtitle] Continue…[/wptabtitle] [wptabcontent]Continue to read about Unity here…

[/wptabcontent] [/wptabs]

]]>
The Unity Interface /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/the-unity-interface/ Sat, 23 Jun 2012 10:20:36 +0000 /?p=10242 Continue reading →]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”] [wptabtitle] The interface[/wptabtitle] [wptabcontent]
The Unity interface can be daunting on first glance. But, for getting started, we can break it down into four sections.The Unity Interface[/wptabcontent]
[wptabtitle] Scene View[/wptabtitle] [wptabcontent]

This is your 3D view, though it differs from 3D views in Blender or Cinema4D. You don’t edit 3D geometry directly in this view. Rather, you use it to place things precisely where you wish them to go. If you wish to edit your geometry, you’ll either need to open it up in a 3D modelling application or install additional components into Unity. You can also see the hierarchical structure of how your scene is composed in the Hierarchy panel below.[/wptabcontent]
[wptabtitle] Basic Movement in the Scene View[/wptabtitle] [wptabcontent]Unity uses key shortcuts similar to Autodesk Maya, but you can change them easily by going to Edit > Preferences.

Look around in your scene
1. Hold Right Mouse Button (RMB) while dragging your mouse sideways will rotate the camera in place.

Rotate around in your scene
1. Holding ALT and press Left Mouse Button (LMB).

Zoom In and Out
1. Hold ALT and RMB, and then drag your mouse in or out or sideways.Alternatively, you can use the drag wheel

Centering on an object.
1. Select an object either in the Scene view or the Hierarchy view.
2. Make sure your cursor is hovering over the Scene view.
3. Press ‘F’ to “focus” in on your object.
[/wptabcontent]

[wptabtitle] Basic Object Manipulation [/wptabtitle] [wptabcontent]
You can use the controls in the top left corner to get into any mode.

The gizmos around the selected object in the Scene will change depending on which mode you are in.

‘W’ : Will put you into Move model

‘E’ : Rotate mode

‘R’ : Scale mode

[/wptabcontent]

[wptabtitle] The Project Panel[/wptabtitle] [wptabcontent]The Project panel is your library of readily available assets you can use in your current scene. Any models or artwork you wish to place into a scene can be dragged from this panel to either the Scene view or the Hierarchy view. When you want to add assets into the Project panel, just save them to the Asset folder inside the Project folder you created at the start. If you have trouble locating where you saved your Unity project, right click on any asset in the Project panel and click on Show in Explorer.

Unity also provides a number of assets ready to go. These are located in the folder named Standard Assets. If you do not find a particular asset here, you might not have imported them when you created the project.

You can easily reimport them by going to Edit -> Import Packages -> DesiredPackage. We will look at the packages in more in depth in the next chapter.
[/wptabcontent]
[wptabtitle] The Inspector[/wptabtitle] [wptabcontent]Finally at the far right is the Inspector. This shows attributes of what you have selected. If you just have an empty game object selected, it will only show you the Transform attributes, which are its Position, Rotation and Scale. This is the base component of all GameObjects. You can position, rotate, and scale objects precisely using the coordinates in this field.

GameObjects are the heart and soul of Unity. Everything in Unity is a GameObject and you add functionality by adding Components to GameObjects much like adding layers to a Photoshop document. Common components are Character Controllers, Rigidbody, Particle Systems, and Audio Files. You can add custom functionality by creating scripts and adding them as components to various GameObjects. You can create subtle complex interaction by layering a few components to various gameobjects.
[/wptabcontent]
[wptabtitle] Continue…[/wptabtitle] [wptabcontent]Continue to learn about Modeling and Unity here[/wptabcontent][/wptabs]

]]>
ArcScene to Sketchup to ArcScene /modeling/software-visualization/sketchup/workflow-sketchup/arcscene-to-sketchup-to-arcscene/ Wed, 09 May 2012 17:01:40 +0000 /?p=9534 “Select” = ‘Properties…’ (very last option) [/wptabcontent] [wptabtitle] Extruding Features[/wptabtitle] … Continue reading →]]> [wptabs style=”wpui-alma” mode=”vertical”] [wptabtitle] Getting Started[/wptabtitle] [wptabcontent]

  • Open ArcScene
  • Add your polygon data from shapefile, geodatabase, or SDE connection
  • “Right Click” on the layer in the Table of Contents ->
    “Select” = ‘Properties…’ (very last option)

[/wptabcontent]
[wptabtitle] Extruding Features[/wptabtitle] [wptabcontent]

  • “Select” ‘Extrusion’ tab on the Layer Properties
    Menu
  • Check the box and then either extrude feature by a
    set value or pre-determined expression. (You can also select and/or construct attribute expressions using the ‘Expression Builder’ button)
  • Visually inspect extruded features in the Dataframe
    and ensure they look to be correct.

extrude the layer
[/wptabcontent]
[wptabtitle] Convert to feature class[/wptabtitle] [wptabcontent]

  • In ArcToolbox > 3D Analyst Tools > Conversion >
    “Layer 3D to Feature Class” is the tool we will use to
    convert the extruded features to a ‘Multipatch’ feature class.
  • Input the corresponding Feature layer to be converted into a Multipatch, put it in a familiar directory for output.

layer3D in toolbox Layer3d to Feature Class
[/wptabcontent]
[wptabtitle] Convert to Collada[/wptabtitle] [wptabcontent]Again in the ArcToolbox > Conversion > To Collada > ‘Multipatch to Collada’ tool is what we will use to output a file in a format Google Sketchup® will recognize.
arctoolbox multipatch2collada
Multipatch to Collada
[/wptabcontent]
[wptabtitle] Import to Sketchup[/wptabtitle] [wptabcontent]

  • Open Google Sketchup® and choose a template that is in the same units as your projection in ArcScene (i.e. meters, Feet and Inches, etc.)
  • In Sketchup > File > Import…
  • Navigate to where you just exported the Collada file from ArcScene and make sure your file type is COLLADA in the drop down menu
  • “Select” > Options…
  • Here you will want to decide if you want to merge coplanar faces – typically for texturing the outsides of builds you do want to merge

Sketchup Import Tool
dae_import_options
[/wptabcontent]
[wptabtitle] Rendering tasks[/wptabtitle] [wptabcontent]Perform all necessary rendering tasks. Be sure to group all elements before saving.[/wptabcontent]
[wptabtitle] Returning to ArcScene[/wptabtitle] [wptabcontent]Getting the model back into ArcScene is almost the exact opposite first we want to export our finished model in Sketchup by “Selecting” File > Export > 3D Model

  • Name the File something relevant and save it in a familiar directory as a COLLADA .dae file
  • Add an empty or populated multipatch feature class into ArcScene or ArcGlobe.
  • Begin a 3D edit session by clicking the 3D Editor drop-down and click “Start Editing”.
  • Click the Edit Placement tool on the 3D Editor toolbar.
  • Click the multipatch feature in the Create Features window.
  • The Insert tool will appear in the Construction Tools window.
  • Select the Insert tool under Construction Tools.
  • Click the desired location of the multipatch model in the 3D view.
  • When prompted, navigate to the location of the supported 3D model file on disk.
  • Select the model and click Open.

***Note you will add the same model over and over again with ever click until you deselect the “Insert Tool”[/wptabcontent]
[wptabtitle] The Result[/wptabtitle] [wptabcontent]By following these steps you can bring your model back and forth between the two programs.

original model

Original model in ArcGIS


post-sketchup model

Post-Sketchup Model


[/wptabcontent]
[/wptabs]

]]>
Using Leica’s COE Plug-In in AutoCAD /scanning/software/leica-software/leica-cyclone/cyclone-workflows/using-leicas-coe-plug-in-with-point-clouds-and-autocad-2010/ Mon, 02 Apr 2012 16:08:08 +0000 5 meters]]> /?p=5686 Continue reading →]]> This workflow will show you how to use Leica’s COE plug-in to import and export objects and points in AutoCAD.
Hint: You can click on any image to see a larger version.

[wptabs style=”wpui-alma” mode=”vertical”]

[wptabtitle] INTRODUCTION[/wptabtitle] [wptabcontent]

Using COE Plug-In to Import & Export Objects and Points in AutoCAD

Leica’s CloudWorx and COE (Cyclone Object Exchange) applications allow the user to view, import, and export files between Cyclone and CAD software while maintaining links and information. This relationship allows the user to take advantage of the accuracy of the point cloud data and the advanced modeling functions in AutoCAD; it also makes comparisons, analysis, and visualizations possible.

The COE import/export tool allows points and modeled objects to be imported/ exported/edited between Cyclone and ACAD (objects can be imported/exported with or without the point cloud data) and must be installed separately. Objects and points can be directly edited in the CAD environment. Importing/exporting points with the COE tool is only recommended for small point sets (less than 1,000,000 points).  See the GMV guide ‘Leica CloudWorx 4.2 and AutoCAD 2012’ for more information about the CloudWorx application.

[/wptabcontent]

 


 

[wptabtitle] CONFIRM INSTALLATION AND SET UNITS[/wptabtitle] [wptabcontent]

I. In ACAD, confirm that the COE tool has been installed (enter COEIN in the command line in ACAD; an import options dialogue box should appear).  If it is not installed, download the installation file from the Leica downloads page – check for updates as the plug-in changes as versions update). During installation, the .exe will open AutoCAD, command line (F2) will note the installation and the availability of new commands such as COEIN & COEOUT.

II. UNITS -> To avoid complications, it is highly recommended to work in the same units as the Cyclone Files > CHECK UNITS IN ALL NEW DRAWINGS BEFORE DRAWING, MODELING, OR IMPORTING > In new ACAD drawing -> Command Line: UNITS > Adjust options to match Cyclone > Generally, Type: Decimal, Insertion Scale Units: Meters > OK

[/wptabcontent]

 

 

[wptabtitle] COE COMMANDS[/wptabtitle] [wptabcontent]

III. The following COE commands may be accessed through these entries or through the toolbar

COEIN :Import COE files into ACAD
COEOUT: Export contents of drawing to COE file
COEXPLODE: explodes blocks into individual objects
COEANN: toggles annotations from cyclone on/off

 

[/wptabcontent]


 

[wptabtitle] IMPORT OBJECTS INTO ACAD[/wptabtitle] [wptabcontent]

IV. To import objects into ACAD -> command line: COEIN -> dialogue box appears -> Under ‘Import File Name’ browse for file -> Import Options:

  • Import objects as ACIS Solids -> imports objects as 3D ACIS solids
  • Import Objects as Blocks -> Blocks are made up of one or more objects that are combined to create a single object; using blocks results in the best compression rate when objects are brought to ACAD (per Cyclone 7.0 Help) and are useful when repeating objects. When editing a block, all similar blocks are simultaneously edited. A block must be exploded or “re-written” to remove or adjust this link between identical blocks. Dynamic blocks are more easily editable and are only available in newer versions of ACAD. See ACAD help -> “Work with blocks” for more information
  • Import Point Sets -> In general, CloudWorx is recommended for large point clouds (1,000,000+ points), while the COE tool is recommended for objects and smaller point clouds (less than 1,000,000 points) -> If Import Point Sets is selected and you experience problems/crashing, it is recommended that you either decrease the size of the point cloud for import or that you use CloudWorx to view the point cloud versus import it
  • Log files -> log files are automatically created, adjust path as desired
  • Units Preference -> UNITS MUST MATCH (see Step II) -> In most cases, scan data is acquired in meters; if imported in a different unit, ACAD should automatically apply a scale factor but using the same units avoids problems (If acquired and imported in the same unit, this scale factor will be 1)

[/wptabcontent]

[wptabtitle] EXPORT OBJECTS FROM AUTOCAD[/wptabtitle] [wptabcontent]

 

V. To export objects from AutoCAD -> Toolbar or command line: COEOUT -> Dialogue box appears -> Browse to project folder and name file -> Select Objects to Export -> OK -> Export Options:

  • Export objects USING ORIGINAL COE file as reference: When selected, the COE file that is created/exported from ACAD references the original Cyclone data set enabling as much original object information/data as possible to be maintained when the object is brought back into Cyclone; select when integrating ACAD data with the original COE file from Cyclone.Export objects WITHOUT original COE reference file: When selected, the COE file is new and maintains no connection or reference to Cyclone data set or original COE file.
  • Export Objects: choose option All, Visible, or Selected objects
  • Units: as in importing in Step VI, UNITS MUST MATCH -> In most cases, scan data is acquired in meters; if exported in a different unit, a scale factor should automatically apply but using the same units avoids problems (If acquired and imported in the same unit, this scale factor will be 1)

[/wptabcontent]

 

[wptabtitle]CONTINUE TO…[/wptabtitle] [wptabcontent]Continue to Using Leica’s COE Plug-In in Cyclone.[/wptabcontent]

[/wptabs]

 

 

]]>