[comp.lsi] Help needed with EDIF graphics

abakus@uklirb (02/12/88)

I'm currently developing a plot program for EDIF 2 0 0. During study of
the EDIF 2 0 0 reference manual, I've discovered some ambiguities that 
should be resolved before I proceed any further.


Problem #1: According to the definition of pathWidth, openShapes are expanded
in the same way as pathes (sp?). The manual doesn't tell it, but I assume 
this implies that cornerType and endType should also be applied to openShapes.
The manual entry for cornerType shows detailed descriptions for the joining
of two line segments. But openShapes often require the joining of a line
segment with an arc or even of two arcs. How is cornerType defined in these
cases? 
One easy solution comes to mind: Use the tangent at the endpoints of an arc
as a pseudo line segment and construct the corner according to the rules
for two line segments. Although this looks reasonable to me, I need a more
authoritive comment.


Problem #2: In order to keep the number of geometric entities low, I don't
want to expand circles annd arcs into line segments. Although this makes some
operations quite complicated, this approach looks rather promising until you
have to deal with instantiation of cells and the associated transformations.
Whenever a cell is instantiated an optional transformation may be applied to
it. This transformation (optionally) includes scaling, rotation and trans-
lation of a view of a cell.
Now, when a cell is scaled nonuniformely in x- and y-direction my problem
arises: What is to be done with arcs and circles, when scaleX != scaleY?
The reference manual says, that all x-coordinates (y-coordinates) have to be
multiplied by scaleX (scaleY). But there are two ways, how this could be done.

a) Let's recall the definition of arc and circle from the manual:
An arc is defined by three control points on the border: start, middle and end.
A circle is defined by two control points on the border which are at either
end of a diameter of the circle.
Method a) scales circles (arcs) by multiplying the 2 (3) control points with
scaleX and scaleY and using the new coordinates for the scaled circles (arcs).
Although this looks quite easy, it isn't. This operation is n_o_t shape
preserving. Let's take a look at the following example:

Consider a circle about the origin, made of four arcs with each arc covering
one whole quadrant. Scaling this figure with scaleX=2 and scaleY=1 produces
a 'lense'-shaped figure with first(?) order discontinuities at the joining of
the four arcs. If the four arcs are placed differently around the circle the
resulting figure will have yet another shape.
Scaling the equivalent circle (by scaling its two control points) with the
same factors as above produces a circle with diameter scaled anywhere
between 1 and 2 and area scaled between 1 and 4. That's a range from no change
at all to four times the area! As is easily seen the size of the resulting
circle depends on the location of the original control points.

Well, I said to myself, This mess couldn't be wanted by the standard committee.
They're clever people and surely had another solution in mind. Let's try
method b).

b) As the reference manual says, a_l_l points have to be scaled; not only the
corner points of polygons and control points of arcs/circles but also a_l_l
points in between. Ok, that's easy for pathes, polygons and rectangles.
They're all made of straight line segments and scaling of end points suffices
to describe all points in between.
Now, what can be done with circles and arcs? Well, the first part is easy:
Just compute the centers and radiuses (sp?) of circles and arcs and scale
them appropriately. But wait, what becomes of circles and arcs, when
scaleX != scaleY? Right, you've guessed it: ellipses and elliptical arcs.

Fine, I said to myself again, That isn't difficult either. There exist plenty
of algorithms to draw and display ellipses and elliptical arcs.
But what, if I don't want to plot that instance?
If I only want to merge that instance with other instances, in order to resolve
the hierarchy an get a 'flat' layout?
If I want to ship that 'flat' layout around, described in terms of EDIF 2 0 0
statements?
That is impossible with means of EDIF 2 0 0, as there is no primitive available
to describe ellipses or elliptical arcs.
What shall I do?

The only solution to this dilemma, that comes to my mind, is to expand all
circles and arcs into line segments prior to instantiation of a cell's view.
Afte scaling every figure looks like method b) has been applied and is still
representable with EDIF 2 0 0 statements. This looks like the ideal solution,
except that it introduces a bulk of new geometric data (i.e. line segments).
Besides the loss of valuable geometric information this method is a contra-
diction to the above stated goal, to use as few geometric entities as possible.
Who can help?


Final note: I've just discovered the gridMap statement. This statement
introduces yet another source of nonuniform scaling of graphic views. The same
questions as discussed above (problem #2) apply to the scaling introduced by
gridMap, too. How should circles and arcs be dealt with, when nonuniform
scaling is applied to a view?


Thanks for your patience with my crude english. I haven't been talking to
a native english speaker for years. I'm looking forward to a_n_y feedback.
Please send your comments/replies to the following address:
...!uunet!unido!uklirb!abakus	or 	abakus%uklirb@unido.uucp


Regards, Michael Doerr.

=========================================================================
Kaiserslautern University
Dept. of Computer Science
Research Group on Computer Structures and Design Sciences
P.O. Box 3049
D-6750 Kaiserslautern, F.R.G.

phone:	    (xx 49 631) 205-2892
telex:	    04-5627 unikl d
telefax:    (xx 49 631) 205-3200
email:	    abakus%uklirb@unido.uucp

moto@cad.Berkeley.EDU (EDIF Committee) (03/05/88)

The EDIF TC has decided to formalize the standards query process, 
To be sure of a response, you should send a copy to Hillary Kahn at U. of
Manchester or to the EDIF User Group Office at 2222 S. Dobson Road,
Mesa, AZ 85202 U.S.A.
We are trying to get to the point where at least the "routine" questions
can be answered by an errata sheet which Hillary is compiling.
 Mike Waters (EDIF Technical Committee)