1
\$\begingroup\$

I have a library component in AutoCAD Eagle. I want to include dimension markings on the Reference layer.

I opened the component library, and used the Dimension tool to mark the dimensions I need. I used the horizontal dimension mode for horizontal dimensions, and vertical dimension mode for vertical dimensions. I placed the dimensions outside of the body of the component itself, so they are easily readable and you can clearly tell what is being marked. So far so good:

enter image description here

However, when I place my component in a layout and rotate it 90 degrees (for layout positioning), these dimension markings shift their positions and become disorganized and difficult to read. The vertical and horizontal dimension markings are overlapping, and are no longer where I placed them on the outside of the component area. This looks sloppy and will cause confusion for users trying to read these dimensions.

enter image description here

If I rotate the component another 90 degrees (so 180 total) then the dimension markings move back to where I had intended them to be. Though, some of the text positions still moved, and created overlaps.

enter image description here

This seems like it could be a bug related to Horizontal vs Vertical dimensions when they are rotated 90 degrees (effectively swapping them between horizontal and vertical mode).

Is there a way to lock the orientation and position of the dimension markings, so they do not adjust location when the component is rotated?

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

Is there a way to lock the orientation and position of the dimension markings, so they do not adjust location when the component is rotated?

It's happened to me and I did this: -

I put the original dimensions on a mechanical layer (an easily switched-off layer) and live with the fact that they do strange things when rotated. Then, when the PCB is almost finished, I'd manually redo the dimensions on the layer that you wish them to be seen.

It would be nice if someone has a proper solution to locking the dimensions but, it wasted about 5 minutes of my time so, realistically, it wasn't that big of a deal to me.

\$\endgroup\$
0
\$\begingroup\$

After some additional investigation, I've confirmed that this is indeed related to the Dimension Type (Vertical vs Horizontal) of the marking.

Here, I select the 37mm vertical dimension, along the left hand side of the component. Note the From and To coordinates: (0, 0) and (25, 37). enter image description here

With the same dimension selected, I changed the DType from Vertical to Horizontal. The dimension is redrawn for a horizontal orientation, but the From and To coordinates are the same. enter image description here

Interestingly, if I then go BACK to Vertical orientation, then the orientation does go back to vertical, but the position does not return to where it should. enter image description here

The variable of interest here is the Align field. This is the value that controls where the dimension is drawn.

It looks like the Align data field is not being applied properly when switching between Horizontal and Vertical modes. And, I suspect that in a layout, rotating the component 90 degrees changes the DType from Horizontal to Vertical and vice versa.

To confirm this, I took a look at the git differences to my library file before and after switching the dimension from Vertical mode to Horizontal mode:

-<dimension x1="0" y1="0" x2="25" y2="37" x3="-4" y3="18.5" textsize="1.27" layer="49" dtype="vertical"/>
+<dimension x1="0" y1="0" x2="25" y2="37" x3="12.5" y3="18.5" textsize="1.27" layer="49" dtype="horizontal"/>

It appears that switching from Vertical mode to Horizontal mode triggers the x3 field (which is the Align field) to be changed from -4 to 12.5. I suspect that behind the scenes, Eagle automatically recalculates the x3 field to be (x1 + x2)/2. This ensures that the text label is position in the middle of the dimension marking.

Back in the GUI, I have also observed that trying to manually adjust the x3 align value will not work when in Horizontal mode. The X align value is locked.


Another thing I found. If the component holding the Dimension objects is rotated, then the values of those dimensions will change based on the new orientation of the component.

Here's an example of the same component rotated 1 degree: enter image description here

Note that both the X and Y dimensions do not rotate with the component - they update their value to give the new X/Y measurements between the two points marked within the component library.

In my opinion, this is highly unexpected and confusing behavior. Dimensions that are added at the component level should be drawn relative to the orientation of the component. They should be static markings, rather than dynamically updating as the component orientation changes.


So in summary:

  1. When Dtype is set to Horizontal, the X align field is locked as (From X Value + To X Value) / 2.

  2. When Dtype is set to Vertical, the Y align field is locked as (From Y Value + To Y Value) / 2.

  3. When a component is rotated, dimension objects change their values dynamically to reflect the relative X/Y distance between the points used to create the dimension object.

  4. This means that dimensions that are placed in a component library will have their alignment and measurement values erroneously modified by Eagle if the component is placed in a different orientation in board layout.


I can see two paths forward:

  1. Add your dimensions at the board layout level, after you have positioned your components, as Andy aka suggested.
  2. Manually add your dimensions with Eagle primitives like lines and text fields, instead of using buggy Dimension objects.
\$\endgroup\$
0
\$\begingroup\$

The real solution is to set the dimension type (Dtype) to Parallel, and simply place the From and To points such that only vertical or horizontal measurement is being measured. With this approach, the measurements will maintain their positions and values statically (the text position may change slightly as the component is rotated).

For this vertical dimension, the X coordinate of the To and From position is set to 25, so that the measurement marking begins 25mm into the board. With both X coordinates equal, only the Y dimension is measured. enter image description here

With the parallel dimension type, the correct dimension information is preserved while rotation angle is set to 1 degree. enter image description here

With the component rotated 90 degrees, the position of the dimension markings is preserved. They are not recalculated because there is no conversion between the vertical and horizontal dimension types. enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.