Model Validation and Repair

Work in Progress

This page is a bare-bones tutorial on how to work with the FME workbenches that translate Multipatch models to OBJ format and validate and repair multipatch models. These workbenches wikll soon be ntegrated nto our ArcGIS tools and tasks. When this occurs, we will add details about using these to this page. In any case, it is good to know how to run these workbenches, since it will inevitable become necessary to troubleshoot them at some point.

FME Workbenches.

Although most of the work we do with building models utilizes ESRI's proprietary multipatch format, which is very well suited to attaching 3d models with a geographically referenced relational database schema, The Multipatch format is not a complete solution for sharing or preserving the model collection.

  • The multipatch version of the model collection is completely reliant on the presence of expansive ESRI licenses.
  • ArcGIS Pro os the only presentation or authoring too that can read or write Multipatch format.
  • ESRI can change the way ArcGIS structures Multipatch objects at any time -- potentially causing them to behave in ways that may not be advantageous.
A ModelStore folder.

To engage with diverse tools for 3D model authoring, and for digital asset management it is necessary to maintain copies of each model in a format that is reliably readable by third party, preferably open-source tool chains. For this archival purpose, the citySchema project have chosen the OBJ format for 3d geometry combined with comma delimited text and geojson foles that preserve the attribute and georeferencing information for models. This open-source exchange arrangement is called the ModelStore.

Repair and Validation

When models are imported into the collection, we use a couple of FME workbenches.

  • Multipatch2ModelStore.fmw checks the integrity of each model and make whatever repairs it can make then writes the OBJ files to a designated Batch\ModelStore folder. The tool also writes validation log, gdb2obj_validation_log.csv is written to the ModelStore folder.
  • ModelStoretoMultipatch reads the OBJ files from the ModelStore and writes them back to Multipatch format. An objtomp_validation_lig.csv is writtent to the ModelStore folder.

By cycling the models through this process, and checking the validation logs, the model curator can gain confidence that the multipatch collection can be round-tripped to and from OBJ format and if anything should happen to the Multipatches or the ESRI licenses or future versions of ArcGIS, the collection can be regenerated form the OBJ modelStore.


Using the Multipatch to ModelStore Model Store Workbench

  1. To begin, you need a sub-folder in your batch named ModelStore. If you have one already that has log files and an OBJ folder, then delete these just have an empty ModelStore Folder.
  2. The user specifies an Input Geodatabase that must contain a multipatch feature class as described below.
  3. The user selects a multipatch feature class name frm a pick-list. The feature class must conform the current model schema (version 4). The input feature class must have one of the following names:
    • AutoAssembled_MP
    • Prep_MP
    • ToValidate_MP
    If you have a feature class that is not named as above, copy it to Scratch\ToValidate_MP to avoid clutter and confusion.
  4. The user also specifies a ModelStore folder that the FME will use to create an OBJ subfolder and the validation logs and a catalog.csv file.
  5. The user should select a Tiling option in most situations, all of the output OBJ files are placed in the OBJ folder. In situations where you have thousands of features or when you are hoping to coordinate with sketchup tiles, you may choose to segment the output according to tile.
  6. The geometry and face orientation are validated and repairs are attempted. A mp2obj_validationlog.csv is created in the ModelStore folder.
  7. The Workbench sets all of the materials to plain white.

When running this workbench it is useful to check the settings Run menu to Prompt for User Parameters and Enable Feature Counting

When running this workbench in FME, It can be useful to watch the progression of the numbers through all of the various transformers.

Check the MPtoOBJ Validation Log

After the workbench has run, the user should open the modelstore and verify that the OBJ files and mp2obj_validation_log.csv have been created. Open the validation log in ArcGIS and look for Geometric errors (like degenerate faces) that were repaired and especially for ones that weren't/ It can be helpful to right-click the table and use Display XY Data to display the locations of these errors.
  • Save the error log point layer in the group layer you are making for your batch.
  • Look at the points on a wireframe and shaded view of the pre-validated models while you flick the shaded viw on and off to see if you can find the errors.
  • FME often finds face orientation errors that are "Not Completely Repaired." We are still trying to figure this out. In the great majority of cases, these do not seem to create a visible problem.

Using the ModelStore to Multipatch Workbench

The ModelStoreToMultipatch.fmw workbench converts a ModelStore repository to a multipatch feature class. The output is a temporary feature class, ordinarily saved in the Scratch geodatabase where it is ready for some final processing to re-integrate it with its attributes and the collection multipatch schema. The steps for using it are as follows:

  1. Enter the following parameters:
    • Input ModelStore Folder containing folder full of OBJ files to be imported.
    • The Target Geodatabase for the output feature class. (This should be your ModelMgt\Scratch.gdb)
    • The Name of the Output Feature Class. (This should be your Validated_MP)
  2. Run the workbench.

You can check your Scratch.gdb for the new Validated_MP feature class. If you are curious, you can examine it. Dont; be surprised that the heights and elevations are exaggerated x3 because the vertical coordinate system is not yet defined.

Re-Connect Attributes and Import Validated Models into Model Schema Template

The new validated multipatch output from FME is a simple feature class with just one attribute, featuring the ModelIDs from the ModelStore (which originated in the original Multipatch FC.). We need to run one more tool to add the original attributes and enable all of the domains and all of the auto-update fields that are expected of multipatch models in the collection.

The geoprocessing tool, 8b. Re-Attribute Validated Models in the ModelMgt toolbox.finishes round-trip of our multipatches through validated OBJ files and back to Multipatch, with all of the original attributes and geodatabase properties restored. To run it, do as follows.

  1. Find the geoprocssing model, 8b. Re-Attribute Validated Models in your ModelMgt toolbox.
  2. Double-click it to open its dialog and enter the following paremeters:
    • Validated_MP The output of the ModelStore2Multipatch workbench run previously.
    • Pre-Validated_MP The original multipatch feature class that ws used in the Multipatch2ModelStore workbench that we started with, above. This wil be the source of the original attributes.
    • Target Geodatabase. This should be the batch geodatabase that is associated with the models we are importing.
    • Target Feature Class Name The name we want to use for the final validated feature class. This is often "Prep_MP."
  3. Run this model!
  4. When the model has run, you should now be able to add your new feature class to the group layer for your batch.
  5. Open the attribute table and count the features to make sure nothing was lost

Check the OBJtoMP Validation Log

The procedure of cycling our multipatch models to repaired and validated OBJ files and back again is intended to assure that the multipatches that we use in the ModelMgt workspace can move back and forth to OBJ without any problems. To make sure we have achieved this goal, we need to checkthe FME validation log created by the ModelStore2Multipatch workbench. This log, named, OBJ2GDB_Validation_log.csv will be found in the ModelStore folder. If there is such log to be found there, this may mean that there were no errors.

  1. Add the OBJ2GDB_Validation_log.csv to ArcGIS.
  2. Open the table and see if there are any un-repaired geometric errors.
  3. If all the errors refer to Incorrect Surface Orientation then this is regarded as OK. We are not quite sure what this means, but have found that these are normally not visible.
  4. If you want to look more closely at the locations of errors, Right-click the CSV file in your ArcGIS table of contents and choose Display XY Data
  5. Move the new layer to the group layer for your Batch.
  6. Look at the points on a wireframe and shaded view of the pre-validated models while you flick the shaded viw on and off to see if you can find the errors.