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

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 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 1774 views
Page 1 of 1 (4 items)
Sort Posts:
  • Wed, Aug 29 2007 6:26 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    Area measurement in Virtuoso Reply

    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
    Herve


    Originally posted in cdnusers.org by hm001
    • Post Points: 0
  • Wed, Aug 29 2007 6:39 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Area measurement in Virtuoso Reply

    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
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Area measurement in Virtuoso Reply

    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
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Area measurement in Virtuoso Reply

    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
Page 1 of 1 (4 items)
Sort Posts:
Started by archive at 29 Aug 2007 06:26 AM. Topic has 2 replies.