Create a grid rated on a phototextured mesh

Create a grid of points on a phototexted mesh from ContextCapture

Here we will analyze the steps to follow to create a grid of points on a phototextured mesh. The latter is the result of a photogrammetric model using ContextCapture.

How?

The first step will be to create an outline that will serve as a delimitation. We will then measure the length and width of this contour according to the general orientation of the phototextured mesh.

We will then place a cell fairly simple (a small cross). Make sure this cell is placed at an easily identifiable altitude: 700m in my example. Use the specification command of the Active Z : AZ=700, so the lockSCA plan.

We will then use the table copy tool and specify the general inclination of our grid, the number of columns and rows, the spacing between columns and rows. We'll get a rectangular grid. Compared with the contour defined above, points are inside and outside.

We will now use the function of closure in order to remove the dots that are out of the contour and do not interest us and remove the element that served as the contour.

Let's now select all the points. Using the tool "Sheet elements" of the tool group "Reality Modeling"Let's move the elements vertically to contact with the phototextured mesh.

We only have to write a very small macro to generate the texts representing the altitude of each point. Be careful that in this macro texts are created with active parameters (size, font,...)

Macro code

Sub Altitudes() Dim ee As ElementEnumerator Dim sc As New ElementScanCriteria sc.ExcludeAllTypes sc.IncludeType msdElementTypeCellHeader  (1)

   Set ee = Application.ActiveModelReference.Scan(sc)   (2)

   Do While ee.MoveNext Dim elTxt As TextElement If ee.Current.AsCellElement.Origin.Z <> 700 Then  (3)
         Set elTxt = CreateTextElement1(Nothing, _ Str(Format(ee.Current.AsCellElement.Origin.Z, ".00")), _ ee.Current.AsCellElement.Origin, _ Matrix3dIdentity)  (4)
         Application.ActiveModelReference. AddElement elTxt End If
   Loop

End Sub
Explanation of code

The code line noted (1) allows only cell-type elements to be analysed. This does not require subsequent filtering.

The line noted (2) executes the scan, analyzing the file elements according to the criteria set out in (1).

Between "Do" and "Loop", all instructions shall be executed for each of the elements meeting the criteria.

The line noted (3) check that these are not the initial points. In my example I kept them, it is not mandatory.

The line noted (4) and the next one creates a type element "text" and add to the active design elements of the drawing file.

Video presentation

To facilitate understanding of the technique, you can view the following video: