Home > Community > Forums > Custom IC Design > Area measurement in Virtuoso

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# Area measurement in Virtuoso

Last post Wed, Aug 29 2007 6:26 AM by archive. 2 replies.
 Started by archive 29 Aug 2007 06:26 AM. Topic has 2 replies and 1845 views
• #### Wed, Aug 29 2007 6:26 AM

• archive
• Joined on Fri, Jul 4 2008
• Posts 88
• Points 4,930
Area measurement in Virtuoso
 Hi all,Is there a way to get the area of a non rectangular selected shape on a given layer in Virtuoso ?Thanks in advance !Best regards HerveOriginally posted in cdnusers.org by hm001
• Post Points: 0
• #### Wed, Aug 29 2007 6:39 AM

• archive
• Joined on Fri, Jul 4 2008
• Posts 88
• Points 4,930
RE: Area measurement in Virtuoso
 Herve,Look at sourcelink solutions 11091704, 11248454 and 11328674 .Regards,Andrew.Originally posted in cdnusers.org by adbeckett
• Post Points: 0
• #### Wed, Aug 29 2007 6:47 AM

• archive
• Joined on Fri, Jul 4 2008
• Posts 88
• Points 4,930
RE: Area measurement in Virtuoso
 Here is the basic formula from: http://www.geometryalgorithms.com/Archive/algorithm_0101/algorithm_0101.htm#area2D_polygon() // area2D_Polygon(): computes the area of a 2D polygon // Input: int n = the number of vertices in the polygon // Point* V = an array of n+2 vertices // with V[n]=V[0] and V[n+1]=V[1] // Return: the (float) area of the polygon float area2D_Polygon( int n, Point* V ) { float area = 0; int i, j, k; // indices for (i=1, j=2, k=0; i<=n; i++, j++, k++) { area += V[i].x * (V[j].y - V[k].y); } return area / 2.0; } Here is some simple skill: procedure(getObjectArea(obj) let(((area 0.0) sum lastPt firstPt crdList dx dy) case(obj~>shape ("polygon" sum = 0 crdList = obj~>path firstPt = lastPt = car(crdList) foreach(crd cdr(crdList) sum = sum + ((xCoord(crd) - xCoord(lastPt)) * (yCoord(crd) + yCoord(lastPt))) lastPt = crd ) sum = sum + ((xCoord(firstPt) - xCoord(lastPt)) * (yCoord(firstPt) + yCoord(lastPt))) area = area + (0.5 * abs(sum)) ) ("rectangle" dx = xCoord(car(obj~>bBox)) - xCoord(cadr(obj~>bBox)) dy = yCoord(car(obj~>bBox)) - yCoord(cadr(obj~>bBox)) area = area + abs( dx * dy ) ) ) float(area) ) ) Originally posted in cdnusers.org by dmay
• Post Points: 0
• #### Wed, Aug 29 2007 6:50 AM

• archive
• Joined on Fri, Jul 4 2008
• Posts 88
• Points 4,930
RE: Area measurement in Virtuoso
 Try Again: ```procedure(MSutGetObjectArea(obj) let(((area 0.0) sum lastPt firstPt crdList dx dy) case(obj~>shape ("polygon" sum = 0 crdList = obj~>path firstPt = lastPt = car(crdList) foreach(crd cdr(crdList) sum = sum + ((xCoord(crd) - xCoord(lastPt)) * (yCoord(crd) + yCoord(lastPt))) lastPt = crd ) sum = sum + ((xCoord(firstPt) - xCoord(lastPt)) * (yCoord(firstPt) + yCoord(lastPt))) area = area + (0.5 * abs(sum)) ) ("rectangle" dx = xCoord(car(obj~>bBox)) - xCoord(cadr(obj~>bBox)) dy = yCoord(car(obj~>bBox)) - yCoord(cadr(obj~>bBox)) area = area + abs( dx * dy ) ) ) float(area) ) ) procedure(MSutGetObjectArea(obj) let(((area 0.0) sum lastPt firstPt crdList dx dy) case(obj~>shape ("polygon" sum = 0 crdList = obj~>path firstPt = lastPt = car(crdList) foreach(crd cdr(crdList) sum = sum + ((xCoord(crd) - xCoord(lastPt)) * (yCoord(crd) + yCoord(lastPt))) lastPt = crd ) sum = sum + ((xCoord(firstPt) - xCoord(lastPt)) * (yCoord(firstPt) + yCoord(lastPt))) area = area + (0.5 * abs(sum)) ) ("rectangle" dx = xCoord(car(obj~>bBox)) - xCoord(cadr(obj~>bBox)) dy = yCoord(car(obj~>bBox)) - yCoord(cadr(obj~>bBox)) area = area + abs( dx * dy ) ) ) float(area) ) ) <\pre>Originally posted in cdnusers.org by dmay ```
• Post Points: 0