70001107 Support 3d shapes and GradientColors for vdPolyface object

Article 70001107
Type Wish
Product WebJS
Version 7011
Date Added 6/22/2017
Fixed 7.7012.0.1 (6/28/2017)
Submitted by Hugh Stevens

Summary

Support 3d shapes and GradientColors for vdPolyface object commonly used for Heat Maps

Solution

In version 7012.0.1 GradientColors of vdPolyface object are also supported by webControl. Also 3d shapes like vdPolyface,vdCone,vdSphere,vdBox,vdHeatMap and new methods that manipulate Polyface were added to vdcanvas object. Examples: AddPolyface(object[] points, object[] facelist, bool drawit, object entities): Adds a new vdPolyface in the document. Example: var VertexList = [ [0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1] ]; var FaceList = [ 1, 2, 3, 4, 1,//first face from indexes 1,2,3,4 and Color index 1. 5, 6, 7, 8, 2,//2nd face from indexes 5, 6, 7, 8 and Color index 2. 1, 2, 6, 5, 3, 2, 3, 7, 6, 4, 3, 4, 8, 7, 5, 4, 1, 5, 8, 6 ]; vdcanvas.AddPolyface(VertexList, FaceList, true); AddCone(object insertionPoint, double BaseRadius, double TopRadius, double height, int numSegmants, bool drawit, object entities) Example: vdcanvas.AddCone([0,0,0], 2, 1, 3, 15, true); AddSphere(object centerPoint, double radius, int longitudinalsegs, int latitudinalsegs, bool drawit, object entities) Example: vdcanvas.AddSphere([0, 0, 0], 2, 20, 10, true); AddBox(object insertionPoint, double length, double width, double height, double rotation, bool drawit, object entities) Example: vdcanvas.AddBox([-2, -2, 0], 6, 3, 10, vdgeo.HALF_PI / 2.0, true); AddHeatMap(object[] points, object[] elevatedcolors, int precision, bool drawit, object entities) Example: var points = [ [0, 0, 0], [6, 0, 0], [6, 6, 0], [0, 6, 0], [1, 1, 1], [5, 1, 1], [5, 5, 1], [1, 5, 1], [2, 4, 2], [4, 4, 2], [4, 2, 2], [2, 2, 2], [3, 3, 3] ]; var elevColors = [ 0, [255, 0, 0], 1, [255, 255, 0], 2, [0, 255, 0], 3, [0, 0, 255] ]; vdcanvas.AddHeatMap(points, elevColors, 8, true); Result: TriangulatePolyface(object pface, int precision) Example: var points = [ [0, 0, 0], [4, 0, 0], [4, 4, 0], [0, 4, 0], [1, 1, 1], [3, 1, 1], [3, 3, 1], [1, 3, 1], [2, 2, 2] ]; var pface = vdcanvas.AddPolyface(points, []); var res = vdcanvas.TriangulatePolyface(pface,8); if(res) vdcanvas.redraw();

Send comments on this topic.