FME Version
Files
-
- 10 MB
- Download
Introduction
This workspace demonstrates some basic approaches for how to add to and manipulate the appearance of 3D data, including raster texture overlay and color styling of solids. This model reads 3D buildings from CAD, uses point cloud from LAS to generate terrain, adds appearance textures from GeoTIFF orthophotos to the terrain and then styles the buildings according to height. The output is written to a 3D PDF.
The ability to style a 3D city model on a conditional factor such as a delineated height provides a powerful tool for data visualization, quickly identifying a group of buildings as being distinct from another on some given attribute. In other words, it highlights features that are important and displays another layer of information.
Source Data
GeoTIFF orthophotos, DWG 3D buildings and LAS point clouds
Step-by-step Instructions
1. Read source
As source data we have buildings, a LAS point cloud and two GeoTIFF orthophotos. When reading in 3D_buildings.dwg, remember to set the parameters: ‘Group Entities by’ to ‘Attribute Schema’ in order to expose the BuildingID attribute.
2. Split the point cloud: PointCloudSplitter
In addition to the X, Y, and Z components, most point clouds have another component, which stores the point cloud classification. This classification is typically used to distinguish between the elevation of the ground, vegetation, and the buildings. For this example all points classified as ground are split from the rest of the points. Set the Split By: to classification, and the ‘Unique Values to Keep’ to 2 for ground classifications.
3. Clip the orthophoto and create a single raster: Clipper and RasterMosaicker
By using the point cloud as the clipper and the orthophotos as clippees, all clippees are clipped to the bounding box of the point cloud. The RasterMosaicker creates a single raster feature from the source orthophotos.
4. Create TIN: TINGenerator
The TINGenerator creates a triangulated irregular network using the points of the point cloud. The surface tolerance determines which input points are added as vertices to the model. The larger the value, the more input points that will be filtered out, and the faster the surface model will be constructed. Set the surface tolerance to 1.
5. Prepare the buildings: Aggregator
The source Autodesk DWG CAD file consists of several features per building. In order to style all buildings consistently, the features are aggregated by a unique building identifier called BuildingID. To demonstrate two different styles, all buildings are split into two groups based on their height. This is done by using the BoundsExtractor to extract the minimum bounding rectangle of the feature’s coordinates into new attributes and then using the TestFilter to filter out whether the maximum is above or below 40m.
In the TestFilter, set Port Definitions to:
6. Add appearance: AppearanceSetter
Appearances may define details of the color of a 3D surface, including its reaction to lighting, or define a texture of a surface. For the buildings under 40m, I have used:
- Diffuse Color: 0.666667,0,0
- Specular Color: 0,0,0
- Shininess: 0
- Alpha: 1
In another AppearanceSetter transformer for buildings taller than 40m, I have used:
- Diffuse Color: 0,0,1
- Specular Color: 1,1,1
- Emissive Color: 0,0,1
- Shininess: 1
- Alpha: 0.9
6.1 Color of 3D surfaces
The effects of the various color parameters are demonstrated by creating two very different styles: A bright and shiny, nearly glass-like appearance and a dark matte color with low reflection.
Diffuse color defines the actual color of the object rather than the reflection. The most obvious effect on the appearance seems to be caused by the specular color. It defines the color of the reflection. A bright specular color can also support the shininess of a surface, while dark tones are useful for a matte effect. For bright and shiny effects it is a good idea to choose a bright emissive color which goes well with the diffuse color. Maximum shininess and some transparency helps to create a glass-like effect. For dark and more dull effects, or to avoid emissive color at all to reduce reflection, it is safe to choose black. Ambient color was avoided in these examples because the effects in the resulting 3D PDF document were minimal.
After experimenting with different settings it is very important to check the results in a native viewer of the chosen format. The results can be very different to the representation you see in the Data Inspector, since all color parameters are largely dependent on the 3D light settings of the different viewers.
6.2 Raster Overlay: AppearanceSetter
The orthophoto is added as an Appearance to the TINSurface geometry. Since the extent of the raster data matches the extent of the surface model, the texture mapping type ‘From Top View’ is chosen.
7. Write data
The data is written to a 3D pdf and represents the 3D model in two different layers. When running the workspace, remember to adjust ‘Rejected Feature Handling’ to ‘Continue Translation’. This setting can be found in the Navigator > Workspace Parameters > Translation.
Completed Workspace
3D PDF output in Adobe Reader
Additional Information
Instead of a single color, different textures can be applied as an appearance to the buildings. Check out the parameters in the AppearanceSetter to style and alter textures.
Data Attribution
The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.
Comments
0 comments
Please sign in to leave a comment.