ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / Managing databases / HFSQL / 
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Calculates the convex hull of the specified 2D polygon. The convex hull is the smallest convex geometry that encloses the entire specified geometry.
The convex hull of an object or group of geometric objects is the smallest convex set that contains the object(s).
In a plane, a convex hull can be compared to the region defined by a rubber band wrapped around the geometries.
Generally, convex hulls are polygons.
Example
// Create a non-convex polygon (see image)
o2DPolygon_1 is Polygon2D
o2DPolygon_1.Outline.AddPoint(-1.00, 3.00)
o2DPolygon_1.Outline.AddPoint(0.00, 4.00)
o2DPolygon_1.Outline.AddPoint(2.00, 3.00)
o2DPolygon_1.Outline.AddPoint(2.00, 2.00)
o2DPolygon_1.Outline.AddPoint(3.00, 3.00)
o2DPolygon_1.Outline.AddPoint(4.00, 2.00)
o2DPolygon_1.Outline.AddPoint(2.00, 1.00)
o2DPolygon_1.Outline.AddPoint(0.00, 1.00)
o2DPolygon_1.Outline.AddPoint(1.00, 0.00)
o2DPolygon_1.Outline.AddPoint(2.00, 0.00)
o2DPolygon_1.Outline.AddPoint(2.00, -3.00)
o2DPolygon_1.Outline.AddPoint(-2.00, -3.00)
o2DPolygon_1.Outline.AddPoint(-2.00, -2.00)
o2DPolygon_1.Outline.AddPoint(-1.00, -2.00)
o2DPolygon_1.Outline.AddPoint(0.00, -1.00)
o2DPolygon_1.Outline.AddPoint(0.00, 0.00)
o2DPolygon_1.Outline.AddPoint(-1.00, 0.00)
o2DPolygon_1.Outline.AddPoint(-2.00, -1.00)
o2DPolygon_1.Outline.AddPoint(-3.00, 0.00)
// Add last point (same as first)
o2DPolygon_1.Outline.AddPoint(-1.00, 3.00)
// Corrects the new geometry
o2DPolygon_1 = o2DPolygon_1.Correct()

// Convex polygon enclosing the input polygon. Dotted line in the image
ConvexHull is Polygon2D = o2DPolygon_1.ConvexHull()
Syntax
<Result> = <Geometry>.ConvexHull()
<Result>: Variable containing spatial data
Variable corresponding to convex geometry. This geometry can correspond to one of the following variable types:
<Geometry>: Polygon2D variable
Name of the Polygon2D variable to be used.
Business / UI classification: Business Logic
Component: wd290hf.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/21/2024

Send a report | Local help