// create new path as first element in elements array smartShape.elem.elements[0] = new Path(); // create new contour as first contour in contours array smartShape.elem.elements[0].contours[0] = new Contour(); // create 2 nodes in the contour by altering the nodes array length smartShape.elem.elements[0].contours[0].nodes.length = 2; // set the predecessor point for the first node to x:25, y:25 smartShape.elem.elements[0].contours[0].nodes[0].predX = 25; smartShape.elem.elements[0].contours[0].nodes[0].predY = 25; // set the main point for the first node to x:25, y:25 smartShape.elem.elements[0].contours[0].nodes[0].x = 25; smartShape.elem.elements[0].contours[0].nodes[0].y = 25; // set the successor point for the first node to x:25, y:25 smartShape.elem.elements[0].contours[0].nodes[0].succX = 25; smartShape.elem.elements[0].contours[0].nodes[0].succY = 25; // set the predecessor point for the second node to x:150, y:50 smartShape.elem.elements[0].contours[0].nodes[1].predX = 150; smartShape.elem.elements[0].contours[0].nodes[1].predY = 50; // set the main point for the second node to x:100, y:100 smartShape.elem.elements[0].contours[0].nodes[1].x = 100; smartShape.elem.elements[0].contours[0].nodes[1].y = 100; // set the successor point for the second node to x:50, y:150 smartShape.elem.elements[0].contours[0].nodes[1].succX = 50; smartShape.elem.elements[0].contours[0].nodes[1].succY = 150;