In Surfer Beta you can now create and work with 3D objects including 3D polylines, 3D polygons, and 3D polymesh! This functionality has also been added to automation. See below for specifications on how to use the new objects and methods in automation:
The AddPolygon3D method was added to the SrfShapeType enumerations.
Method | Description | Mapid |
---|---|---|
AddPolygon3D | Adds a new simple 3D polygon shape. | 41253 |
AddPolygon3D()
Parameter | Type | Required/Optional | Default | Description |
---|---|---|---|---|
VerticesXY | Array of doubles | Required | N/A | The X and Y coordinates (first entry is X coordinate of first vertex, second entry is Y coordinate of first vertex, third entry is X coordinate of second vertex. etc.) for the new 3D polygon. |
VerticesZ | Array of doubles | Required | N/A | The Z coordinates for the new 3D polygon. |
Syntax
Set Polygon3D = object.AddPolygon3D(VerticesXY, VerticesZ)
Remarks
Returns an IPolygon3D object.
Example
This example demonstrates how to add a 3D polygon to a plot document.
Sub Main Set surf = GetObject(,"Surfer.Application") Set plotdoc1 = surf.Documents.Add(srfDocPlot) Set shapes1 = plotdoc1.Shapes Dim polygon3dcoordsXY(7) As Double polygon3dcoordsXY(0) = 1 : polygon3dcoordsXY(1) = 2 polygon3dcoordsXY(2) = 2 : polygon3dcoordsXY(3) = 2.5 polygon3dcoordsXY(4) = 3 : polygon3dcoordsXY(5) = 2.0 polygon3dcoordsXY(6) = 4 : polygon3dcoordsXY(7) = 2.5 Dim polygon3dcoordsZ(3) As Double polygon3dcoordsZ(0) = 1 : polygon3dcoordsZ(1) = 2 polygon3dcoordsZ(2) = 3 : polygon3dcoordsZ(3) =4 Set polygon3d = shapes1.AddPolygon3D(polygon3dcoordsXY, polygon3dcoordsZ) 'use the 3D polygon object from here on End Sub
SrfShapeType Values
Enumeration | Value | Description |
---|---|---|
srfShapeRangeRing | 38 | range ring |
srfShapeGridValue | 39 | grid value |
srfShapePointCloud | 40 | point cloud |
srfShapeRaster | 41 | raster |
srfShapePeaksDepressions | 42 | peaks and depressions |
srfShapePolyline3D | 43 | 3D polyline |
srfShapePolygon3D | 44 | 3D polygon |
srfShapePolymesh | 45 | polymesh |
Updated January 2021
Comments
0 comments
Please sign in to leave a comment.