I failed to search the manual and the forum to find a way to copy and rotate a shape I created with any agle like 15, 30, 45 etc.
I noticed some posts said that rotate with any angle may raise lithography issues. But in MEMS application, it's very popular to use all kinds of "strange" shapes. As the line/space is over 1um, the litho problem can be neglected. Then, what can I do in skill code?
Not sure of your application but have you tried
dbCopyFig( d_fig d_cellView [ l_transform ] )
Use the transform option to rotate the object. '((0 0) "R90" 1.0) would rotate the object 90 degrees.
There's dbTransformCellView which will transform everything in a cellView by the specified magnification and angle. Note that this cannot transform objects which are constrained to only be at 90 degree multiples (such as instances), so you should normally do this on flat layout.
So if you want to transform selected shapes, what you could do is write a function which moves them (using dbMoveFig) to a temporary cellView, does a dbTransformCellView() and then moves them back to the original cellView.
This is probably easier than trying to write your own code to transform every kind of shape by arbitrary angles. There's leHiRotate, but this is an "hi" function and doesn't have a procedural equivalent.
Hi Richard, Andrew,
Ha; I did not know dbTransformCellView could do that! Andrew is right, of course; that is indeed the easiest solution—provided that function is available in your version of Virtuoso.
I had started writing a small solution; I’ll append it here in case it helps. It basically implements arbitrary affine transformations on points, plus a small dbCopyFig-like helper function:
matrix = VedaGeomAffineMakeIdentity()
matrix = VedaGeomAffineScale(matrix 2.0 0.5)
matrix = VedaGeomAffineRotate(matrix 30*degrees)
VedaGeomAffineCopyFig(fig cv matrix)
I’ve included a tiny demo in the source tree; it draws some shapes on the y* layers of a given cell view:
You can find the code (full of TODOs) here (Git repository, snapshot):
The license is MIT/Expat. Let me know if you need more info… or have some patches :)